Class EmailMessage

java.lang.Object
com.azure.communication.email.models.EmailMessage

public final class EmailMessage extends Object
Message payload for sending an email.
  • Constructor Details

    • EmailMessage

      public EmailMessage()
  • Method Details

    • getHeaders

      public Map<String,String> getHeaders()
      Get the headers property: Custom email headers to be passed.
      Returns:
      the headers value.
    • setHeaders

      public EmailMessage setHeaders(Map<String,String> headers)
      Set the headers property: Custom email headers to be passed.
      Parameters:
      headers - the headers value to set.
      Returns:
      the EmailMessage object itself.
    • getSenderAddress

      public String getSenderAddress()
      Get the senderAddress property: Sender email address from a verified domain.
      Returns:
      the senderAddress value.
    • setSenderAddress

      public EmailMessage setSenderAddress(String senderAddress)
      Set the senderAddress property: Sender email address from a verified domain.
      Parameters:
      senderAddress - the senderAddress value to set.
      Returns:
      the EmailMessage object itself.
    • getSubject

      public String getSubject()
      Get the subject property: Subject of the email message.
      Returns:
      the subject value.
    • setSubject

      public EmailMessage setSubject(String subject)
      Set the subject property: Subject of the email message.
      Parameters:
      subject - the subject value to set.
      Returns:
      the EmailMessage object itself.
    • getBodyPlainText

      public String getBodyPlainText()
      Get the bodyPlainText property: Plain text version of the email message.
      Returns:
      the bodyPlainText value.
    • setBodyPlainText

      public EmailMessage setBodyPlainText(String bodyPlainText)
      Set the bodyPlainText property: Plain text version of the email message.
      Parameters:
      bodyPlainText - the bodyPlainText value to set.
      Returns:
      the EmailMessage object itself.
    • getBodyHtml

      public String getBodyHtml()
      Get the bodyHtml property: Html version of the email message.
      Returns:
      the html value.
    • setBodyHtml

      public EmailMessage setBodyHtml(String bodyHtml)
      Set the bodyHtml property: Html version of the email message.
      Parameters:
      bodyHtml - the html value to set.
      Returns:
      the EmailContent object itself.
    • getToRecipients

      public List<EmailAddress> getToRecipients()
      Get the toRecipients property: Email To recipients.
      Returns:
      the toRecipients value.
    • setToRecipients

      public EmailMessage setToRecipients(List<EmailAddress> toRecipients)
      Set the toRecipients property: Email To recipients.
      Parameters:
      toRecipients - the toRecipients value to set.
      Returns:
      the EmailContent object itself.
    • setToRecipients

      public EmailMessage setToRecipients(EmailAddress... toRecipients)
      Set the toRecipients property: Email To recipients.
      Parameters:
      toRecipients - the toRecipients value to set.
      Returns:
      the EmailContent object itself.
    • setToRecipients

      public EmailMessage setToRecipients(String... toRecipientAddresses)
      Set the toRecipients property: Email To recipients.
      Parameters:
      toRecipientAddresses - the addresses of the toRecipients to set.
      Returns:
      the EmailContent object itself.
    • getCcRecipients

      public List<EmailAddress> getCcRecipients()
      Get the ccRecipients property: Email CC recipients.
      Returns:
      the cc value.
    • setCcRecipients

      public EmailMessage setCcRecipients(List<EmailAddress> ccRecipients)
      Set the ccRecipients property: Email CC recipients.
      Parameters:
      ccRecipients - the cc value to set.
      Returns:
      the EmailMessage object itself.
    • setCcRecipients

      public EmailMessage setCcRecipients(EmailAddress... ccRecipients)
      Set the ccRecipients property: Email CC recipients.
      Parameters:
      ccRecipients - the cc value to set.
      Returns:
      the EmailMessage object itself.
    • setCcRecipients

      public EmailMessage setCcRecipients(String... ccRecipientAddresses)
      Set the ccRecipients property: Email CC recipients.
      Parameters:
      ccRecipientAddresses - the addresses of the ccRecipients to set.
      Returns:
      the EmailContent object itself.
    • getBccRecipients

      public List<EmailAddress> getBccRecipients()
      Get the bccRecipients property: Email BCC recipients.
      Returns:
      the bCC value.
    • setBccRecipients

      public EmailMessage setBccRecipients(List<EmailAddress> bccRecipients)
      Set the bccRecipients property: Email BCC recipients.
      Parameters:
      bccRecipients - the bccRecipients value to set.
      Returns:
      the EmailRecipients object itself.
    • setBccRecipients

      public EmailMessage setBccRecipients(EmailAddress... bccRecipients)
      Set the bccRecipients property: Email BCC recipients.
      Parameters:
      bccRecipients - the bccRecipients value to set.
      Returns:
      the EmailRecipients object itself.
    • setBccRecipients

      public EmailMessage setBccRecipients(String... bccRecipientAddresses)
      Set the bccRecipients property: Email BCC recipients.
      Parameters:
      bccRecipientAddresses - the addresses of the bccRecipients to set.
      Returns:
      the EmailContent object itself.
    • getAttachments

      public List<EmailAttachment> getAttachments()
      Get the attachments property: List of attachments. Please note that we limit the total size of an email request (which includes attachments) to 10MB.
      Returns:
      the attachments value.
    • setAttachments

      public EmailMessage setAttachments(List<EmailAttachment> attachments)
      Set the attachments property: List of attachments. Please note that we limit the total size of an email request (which includes attachments) to 10MB.
      Parameters:
      attachments - the attachments value to set.
      Returns:
      the EmailMessage object itself.
    • setAttachments

      public EmailMessage setAttachments(EmailAttachment... attachments)
      Set the attachments property: List of attachments. Please note that we limit the total size of an email request (which includes attachments) to 10MB.
      Parameters:
      attachments - the attachments value to set.
      Returns:
      the EmailMessage object itself.
    • getReplyTo

      public List<EmailAddress> getReplyTo()
      Get the replyTo property: Email addresses where recipients' replies will be sent to.
      Returns:
      the replyTo value.
    • setReplyTo

      public EmailMessage setReplyTo(List<EmailAddress> replyTo)
      Set the replyTo property: Email addresses where recipients' replies will be sent to.
      Parameters:
      replyTo - the replyTo value to set.
      Returns:
      the EmailMessage object itself.
    • setReplyTo

      public EmailMessage setReplyTo(EmailAddress... replyTo)
      Set the replyTo property: Email addresses where recipients' replies will be sent to.
      Parameters:
      replyTo - the replyTo value to set.
      Returns:
      the EmailMessage object itself.
    • isUserEngagementTrackingDisabled

      public Boolean isUserEngagementTrackingDisabled()
      Get the disableUserEngagementTracking property: Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.
      Returns:
      the userEngagementTrackingDisabled value.
    • setUserEngagementTrackingDisabled

      public EmailMessage setUserEngagementTrackingDisabled(Boolean userEngagementTrackingDisabled)
      Set the userEngagementTrackingDisabled property: Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.
      Parameters:
      userEngagementTrackingDisabled - the userEngagementTrackingDisabled value to set.
      Returns:
      the EmailMessage object itself.