public class EmailMessage extends Object implements Serializable
Constructor and Description |
---|
EmailMessage() |
Modifier and Type | Method and Description |
---|---|
EmailMessage |
addSubstitutionsEntry(String key,
List<String> value)
Default message substitutions.
|
EmailMessage |
clearSubstitutionsEntries()
Removes all the entries added into Substitutions.
|
boolean |
equals(Object obj) |
String |
getBody()
The body of the email message.
|
String |
getFeedbackForwardingAddress()
The email address that bounces and complaints will be forwarded to when
feedback forwarding is enabled.
|
String |
getFromAddress()
The email address used to send the email from.
|
RawEmail |
getRawEmail()
An email represented as a raw MIME message.
|
List<String> |
getReplyToAddresses()
The reply-to email address(es) for the email.
|
SimpleEmail |
getSimpleEmail()
An email composed of a subject, a text part and a html part.
|
Map<String,List<String>> |
getSubstitutions()
Default message substitutions.
|
int |
hashCode() |
void |
setBody(String body)
The body of the email message.
|
void |
setFeedbackForwardingAddress(String feedbackForwardingAddress)
The email address that bounces and complaints will be forwarded to when
feedback forwarding is enabled.
|
void |
setFromAddress(String fromAddress)
The email address used to send the email from.
|
void |
setRawEmail(RawEmail rawEmail)
An email represented as a raw MIME message.
|
void |
setReplyToAddresses(Collection<String> replyToAddresses)
The reply-to email address(es) for the email.
|
void |
setSimpleEmail(SimpleEmail simpleEmail)
An email composed of a subject, a text part and a html part.
|
void |
setSubstitutions(Map<String,List<String>> substitutions)
Default message substitutions.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
EmailMessage |
withBody(String body)
The body of the email message.
|
EmailMessage |
withFeedbackForwardingAddress(String feedbackForwardingAddress)
The email address that bounces and complaints will be forwarded to when
feedback forwarding is enabled.
|
EmailMessage |
withFromAddress(String fromAddress)
The email address used to send the email from.
|
EmailMessage |
withRawEmail(RawEmail rawEmail)
An email represented as a raw MIME message.
|
EmailMessage |
withReplyToAddresses(Collection<String> replyToAddresses)
The reply-to email address(es) for the email.
|
EmailMessage |
withReplyToAddresses(String... replyToAddresses)
The reply-to email address(es) for the email.
|
EmailMessage |
withSimpleEmail(SimpleEmail simpleEmail)
An email composed of a subject, a text part and a html part.
|
EmailMessage |
withSubstitutions(Map<String,List<String>> substitutions)
Default message substitutions.
|
public String getBody()
public void setBody(String body)
body
- The body of the email message.public EmailMessage withBody(String body)
Returns a reference to this object so that method calls can be chained together.
body
- The body of the email message.public String getFeedbackForwardingAddress()
public void setFeedbackForwardingAddress(String feedbackForwardingAddress)
feedbackForwardingAddress
- The email address that bounces and
complaints will be forwarded to when feedback forwarding is
enabled.public EmailMessage withFeedbackForwardingAddress(String feedbackForwardingAddress)
Returns a reference to this object so that method calls can be chained together.
feedbackForwardingAddress
- The email address that bounces and
complaints will be forwarded to when feedback forwarding is
enabled.public String getFromAddress()
public void setFromAddress(String fromAddress)
fromAddress
- The email address used to send the email from.
Defaults to use FromAddress specified in the Email Channel.public EmailMessage withFromAddress(String fromAddress)
Returns a reference to this object so that method calls can be chained together.
fromAddress
- The email address used to send the email from.
Defaults to use FromAddress specified in the Email Channel.public RawEmail getRawEmail()
public void setRawEmail(RawEmail rawEmail)
rawEmail
- An email represented as a raw MIME message.public EmailMessage withRawEmail(RawEmail rawEmail)
Returns a reference to this object so that method calls can be chained together.
rawEmail
- An email represented as a raw MIME message.public List<String> getReplyToAddresses()
public void setReplyToAddresses(Collection<String> replyToAddresses)
replyToAddresses
- The reply-to email address(es) for the email. If
the recipient replies to the email, each reply-to address will
receive the reply.public EmailMessage withReplyToAddresses(String... replyToAddresses)
Returns a reference to this object so that method calls can be chained together.
replyToAddresses
- The reply-to email address(es) for the email. If
the recipient replies to the email, each reply-to address will
receive the reply.public EmailMessage withReplyToAddresses(Collection<String> replyToAddresses)
Returns a reference to this object so that method calls can be chained together.
replyToAddresses
- The reply-to email address(es) for the email. If
the recipient replies to the email, each reply-to address will
receive the reply.public SimpleEmail getSimpleEmail()
public void setSimpleEmail(SimpleEmail simpleEmail)
simpleEmail
- An email composed of a subject, a text part and a html
part.public EmailMessage withSimpleEmail(SimpleEmail simpleEmail)
Returns a reference to this object so that method calls can be chained together.
simpleEmail
- An email composed of a subject, a text part and a html
part.public Map<String,List<String>> getSubstitutions()
public void setSubstitutions(Map<String,List<String>> substitutions)
substitutions
- Default message substitutions. Can be overridden by
individual address substitutions.public EmailMessage withSubstitutions(Map<String,List<String>> substitutions)
Returns a reference to this object so that method calls can be chained together.
substitutions
- Default message substitutions. Can be overridden by
individual address substitutions.public EmailMessage addSubstitutionsEntry(String key, List<String> value)
The method adds a new key-value pair into Substitutions parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into Substitutions.value
- The corresponding value of the entry to be added into
Substitutions.public EmailMessage clearSubstitutionsEntries()
Returns a reference to this object so that method calls can be chained together.
public String toString()
toString
in class Object
Object.toString()
Copyright © 2019. All rights reserved.