Package com.apgar.common.lib.mail
Class MailSpecif
java.lang.Object
com.apgar.common.lib.mail.MailSpecif
Represents a mail specification for sending emails. This class is utilized by the
MailService to construct email messages.- Author:
- APGAR Consulting
-
Constructor Summary
ConstructorsConstructorDescriptionMailSpecif(String subject, String content, com.orchestranetworks.service.Role toRole, com.orchestranetworks.instance.Repository repository) Constructs a MailSpecif instance with a subject, a body, and recipients belonging to a specific role (toRole).MailSpecif(String subject, String content, com.orchestranetworks.service.UserReference toUser, com.orchestranetworks.instance.Repository repository) Constructs a MailSpecif instance for a specific user as the recipient, along with a specific subject and content.MailSpecif(String subject, String content, String to) Constructs a MailSpecif with the specified subject, content, and recipients.MailSpecif(String subject, String content, String to, String bcc) Constructs a MailSpecif with the specified subject, content, recipients, and bcc recipients.Constructs a MailSpecif with the specified subject, content, sender, recipients, and bcc recipients.Constructs a MailSpecif instance with the specified subject, content, sender, recipients, and bcc recipients.Constructs a MailSpecif instance with the specified subject, content, sender, recipients, cc recipients, and bcc recipients.Constructs a MailSpecif with the specified subject, content, sender, and recipients.Constructs a MailSpecif with the specified subject, content, sender, recipients, and bcc recipients.Constructs a MailSpecif instance with the specified subject, content, sender, recipients, cc recipients, and bcc recipients.MailSpecif(String subject, String content, Set<String> to) Constructs a MailSpecif with the specified subject, content, and recipients.Constructs a MailSpecif with the specified subject, content, recipients, and bcc recipients. -
Method Summary
Modifier and TypeMethodDescriptionReturns the attachment file.getBcc()Returns a set of bcc recipient email addresses.getCc()Returns a set of cc recipient email addresses.Returns the body content of the email.Returns the name of the attachment file.getFrom()Returns the sender's email address.Returns the subject of the email.getTo()Returns a set of recipient email addresses.voidsetAttachment(File file) Sets the attachment file for the email.voidSets the bcc recipient email addresses.voidSets the cc recipient email addresses from a string.voidSets the cc recipient email addresses.voidsetContent(String content) Sets the body content of the email.voidsetFileName(String fileName) Sets the name of the attachment file.voidSets the sender's email address.voidsetSubject(String subject) Sets the subject of the email.voidSets the recipient email addresses from a single string.voidSets the recipient email addresses.
-
Constructor Details
-
MailSpecif
Constructs a MailSpecif with the specified subject, content, and recipients.- Parameters:
subject- the subject of the email.content- the body of the email.to- a set of recipient email addresses.
-
MailSpecif
Constructs a MailSpecif with the specified subject, content, sender, and recipients.- Parameters:
subject- the subject of the email.content- the body of the email.from- the sender's email address.to- a set of recipient email addresses.
-
MailSpecif
Constructs a MailSpecif with the specified subject, content, recipients, and bcc recipients.- Parameters:
subject- the subject of the email.content- the body of the email.to- a set of recipient email addresses.bcc- a set of blind carbon copy (hidden) recipient email addresses.
-
MailSpecif
Constructs a MailSpecif with the specified subject, content, sender, recipients, and bcc recipients.- Parameters:
subject- the subject of the email.content- the body of the email.from- the sender's email address.to- a set of recipient email addresses.bcc- a set of blind carbon copy (hidden) recipient email addresses.
-
MailSpecif
Constructs a MailSpecif with the specified subject, content, and recipients. The recipients should be provided as semicolon-separated strings.- Parameters:
subject- the subject of the email.content- the body of the email.to- a string of recipient email addresses separated by semicolons.
-
MailSpecif
Constructs a MailSpecif with the specified subject, content, recipients, and bcc recipients. The recipients should be provided as semicolon-separated strings.- Parameters:
subject- the subject of the email.content- the body of the email.to- a string of recipient email addresses separated by semicolons.bcc- a string of blind carbon copy (hidden) recipient email addresses separated by semicolons.
-
MailSpecif
Constructs a MailSpecif with the specified subject, content, sender, recipients, and bcc recipients. The recipients should be provided as semicolon-separated strings.- Parameters:
subject- the subject of the email.content- the body of the email.from- the sender's email address.to- a string of recipient email addresses separated by semicolons.bcc- a string of blind carbon copy (hidden) recipient email addresses separated by semicolons.
-
MailSpecif
public MailSpecif(String subject, String content, String from, String to, Set<String> cc, String bcc) Constructs a MailSpecif instance with the specified subject, content, sender, recipients, cc recipients, and bcc recipients. Both To and bcc recipients should be provided as semicolon-separated strings.- Parameters:
subject- the subject of the email.content- the body content of the email.from- the sender's email address.to- a semicolon-separated string of recipient email addresses.cc- a set of email addresses for carbon copy recipients.bcc- a semicolon-separated string of blind carbon copy (hidden) recipient email addresses.
-
MailSpecif
public MailSpecif(String subject, String content, String from, Set<String> to, Set<String> cc, String bcc) Constructs a MailSpecif instance with the specified subject, content, sender, recipients, cc recipients, and bcc recipients. The bcc recipients should be provided as a semicolon-separated string.- Parameters:
subject- the subject of the email.content- the body content of the email.from- the sender's email address.to- a set of email addresses for recipients.cc- a set of email addresses for carbon copy recipients.bcc- a semicolon-separated string of blind carbon copy recipient email addresses.
-
MailSpecif
Constructs a MailSpecif instance with the specified subject, content, sender, recipients, and bcc recipients. The To recipients should be provided as a semicolon-separated string.- Parameters:
subject- the subject of the email.content- the body content of the email.from- the sender's email address.to- a semicolon-separated string of recipient email addresses.bcc- a set of email addresses for blind carbon copy recipients.
-
MailSpecif
public MailSpecif(String subject, String content, com.orchestranetworks.service.UserReference toUser, com.orchestranetworks.instance.Repository repository) Constructs a MailSpecif instance for a specific user as the recipient, along with a specific subject and content.- Parameters:
subject- the subject of the email.content- the body content of the email.toUser- the recipient's user ID as aUserReference.repository- the repository used to fetch user details.
-
MailSpecif
public MailSpecif(String subject, String content, com.orchestranetworks.service.Role toRole, com.orchestranetworks.instance.Repository repository) Constructs a MailSpecif instance with a subject, a body, and recipients belonging to a specific role (toRole).- Parameters:
subject- the subject of the email.content- the body content of the email.toRole- theRolewhose users will be recipients of the email.repository- the repository used to fetch user details.
-
-
Method Details
-
getSubject
Returns the subject of the email.- Returns:
- the subject of the email.
-
getContent
Returns the body content of the email.- Returns:
- the body content of the email.
-
getTo
Returns a set of recipient email addresses.- Returns:
- a set of recipient email addresses.
-
setTo
Sets the recipient email addresses.- Parameters:
to- a set of recipient email addresses.
-
setTo
Sets the recipient email addresses from a single string.- Parameters:
to- the recipient email address.
-
setCc
Sets the cc recipient email addresses from a string.- Parameters:
cc- the carbon copy recipient email address.
-
getFrom
Returns the sender's email address.- Returns:
- the sender's email address.
-
setFrom
Sets the sender's email address.- Parameters:
from- the sender's email address.
-
getCc
Returns a set of cc recipient email addresses.- Returns:
- a set of carbon copy recipient email addresses.
-
setCc
Sets the cc recipient email addresses.- Parameters:
cc- a set of carbon copy recipient email addresses.
-
getBcc
Returns a set of bcc recipient email addresses.- Returns:
- a set of blind carbon copy recipient email addresses.
-
setBcc
Sets the bcc recipient email addresses.- Parameters:
bcc- a set of blind carbon copy recipient email addresses.
-
setSubject
Sets the subject of the email.- Parameters:
subject- the subject of the email.
-
setContent
Sets the body content of the email.- Parameters:
content- the body content of the email.
-
setAttachment
Sets the attachment file for the email.- Parameters:
file- the attachment file.
-
setFileName
Sets the name of the attachment file.- Parameters:
fileName- the name of the attachment file.
-
getAttachment
Returns the attachment file.- Returns:
- the attachment file.
-
getFileName
Returns the name of the attachment file.- Returns:
- the name of the attachment file.
-