Class MailSpecif

java.lang.Object
com.apgar.common.lib.mail.MailSpecif

public class MailSpecif extends Object
Represents a mail specification for sending emails. This class is utilized by the MailService to construct email messages.
Author:
APGAR Consulting
  • Constructor Details

    • MailSpecif

      public MailSpecif(String subject, String content, Set<String> to)
      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

      public MailSpecif(String subject, String content, String from, Set<String> to)
      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

      public MailSpecif(String subject, String content, Set<String> to, Set<String> bcc)
      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

      public MailSpecif(String subject, String content, String from, Set<String> to, Set<String> bcc)
      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

      public MailSpecif(String subject, String content, String to)
      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

      public MailSpecif(String subject, String content, String to, String bcc)
      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

      public MailSpecif(String subject, String content, String from, String to, String bcc)
      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

      public MailSpecif(String subject, String content, String from, String to, Set<String> bcc)
      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 a UserReference.
      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 - the Role whose users will be recipients of the email.
      repository - the repository used to fetch user details.
  • Method Details

    • getSubject

      public String getSubject()
      Returns the subject of the email.
      Returns:
      the subject of the email.
    • getContent

      public String getContent()
      Returns the body content of the email.
      Returns:
      the body content of the email.
    • getTo

      public Set<String> getTo()
      Returns a set of recipient email addresses.
      Returns:
      a set of recipient email addresses.
    • setTo

      public void setTo(Set<String> to)
      Sets the recipient email addresses.
      Parameters:
      to - a set of recipient email addresses.
    • setTo

      public void setTo(String to)
      Sets the recipient email addresses from a single string.
      Parameters:
      to - the recipient email address.
    • setCc

      public void setCc(String cc)
      Sets the cc recipient email addresses from a string.
      Parameters:
      cc - the carbon copy recipient email address.
    • getFrom

      public String getFrom()
      Returns the sender's email address.
      Returns:
      the sender's email address.
    • setFrom

      public void setFrom(String from)
      Sets the sender's email address.
      Parameters:
      from - the sender's email address.
    • getCc

      public Set<String> getCc()
      Returns a set of cc recipient email addresses.
      Returns:
      a set of carbon copy recipient email addresses.
    • setCc

      public void setCc(Set<String> cc)
      Sets the cc recipient email addresses.
      Parameters:
      cc - a set of carbon copy recipient email addresses.
    • getBcc

      public Set<String> getBcc()
      Returns a set of bcc recipient email addresses.
      Returns:
      a set of blind carbon copy recipient email addresses.
    • setBcc

      public void setBcc(Set<String> bcc)
      Sets the bcc recipient email addresses.
      Parameters:
      bcc - a set of blind carbon copy recipient email addresses.
    • setSubject

      public void setSubject(String subject)
      Sets the subject of the email.
      Parameters:
      subject - the subject of the email.
    • setContent

      public void setContent(String content)
      Sets the body content of the email.
      Parameters:
      content - the body content of the email.
    • setAttachment

      public void setAttachment(File file)
      Sets the attachment file for the email.
      Parameters:
      file - the attachment file.
    • setFileName

      public void setFileName(String fileName)
      Sets the name of the attachment file.
      Parameters:
      fileName - the name of the attachment file.
    • getAttachment

      public File getAttachment()
      Returns the attachment file.
      Returns:
      the attachment file.
    • getFileName

      public String getFileName()
      Returns the name of the attachment file.
      Returns:
      the name of the attachment file.