This class will handle the email attachments organization. Every email must have
its own attachments directory so that we can avoid file issues between emails.
Represents the public API for the Email service of the system. External users must use this
class for all the email operations except.
Important: Since the attachments will be flat-stored in the "uploads/attachmetns" directory
the "send" and "queue" method will have to perform multiple writes to the database in order to get
robust attachment handling that will not crash the rest of the service.
Important: This value object is not going to check if the attachment file exists in the
server because that would cause problems with the service usage (e.g. if an attachment
file is missing an exception would halt all the email service operations).
Important: This value object is not going to check if the attachment file exists in the
server because that would cause problems with the service usage (e.g. if an attachment
file is missing an exception would halt all the email service operations).
Reads email records from the database. This class provides a customizable interface
for reading operations so that it is possible to build different variations in the
EmailRepository class (e.g. "getPending", "findById", "getAll").
Handles the database operations that concern the email records of the
database. It provides a layer for more complicated methods that use the
writer, reader and deleter.