public class Mail
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
ASM |
asm
The email's unsubscribe handling object.
|
java.util.List<Attachments> |
attachments
The email's attachments.
|
java.lang.String |
batchId
This ID represents a batch of emails to be sent at the
same time.
|
java.util.List<java.lang.String> |
categories
The email's categories.
|
java.util.List<Content> |
content
The email's content.
|
java.util.Map<java.lang.String,java.lang.String> |
customArgs
The email's custom arguments.
|
Email |
from
The email's from field.
|
java.util.Map<java.lang.String,java.lang.String> |
headers
The email's headers.
|
java.lang.String |
ipPoolId
The email's IP pool name.
|
MailSettings |
mailSettings
The email's mail settings.
|
java.util.List<Personalization> |
personalization
The email's personalization.
|
Email |
replyTo
The email's reply to address.
|
java.util.Map<java.lang.String,java.lang.String> |
sections
The email's sections.
|
long |
sendAt
A unix timestamp allowing you to specify when you want
your email to be delivered.
|
java.lang.String |
subject
The email's subject line.
|
java.lang.String |
templateId
The email's template ID.
|
TrackingSettings |
trackingSettings
The email's tracking settings.
|
Constructor and Description |
---|
Mail()
Construct a new Mail object.
|
Mail(Email from,
java.lang.String subject,
Email to,
Content content)
Construct a new Mail object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttachments(Attachments attachments)
Add attachments to the email.
|
void |
addCategory(java.lang.String category)
Add a category to the email.
|
void |
addContent(Content content)
Add content to this email.
|
void |
addCustomArg(java.lang.String key,
java.lang.String value)
Add a custom argument to the email.
|
void |
addHeader(java.lang.String key,
java.lang.String value)
Add a header to the email.
|
void |
addPersonalization(Personalization personalization)
Add a personalizaton to the email.
|
void |
addSection(java.lang.String key,
java.lang.String value)
Add a section to the email.
|
java.lang.String |
build()
Create a string represenation of the Mail object JSON.
|
java.lang.String |
buildPretty()
Create a string represenation of the Mail object JSON and pretty print it.
|
boolean |
equals(java.lang.Object obj) |
ASM |
getASM()
Get the email's unsubscribe handling object (ASM).
|
java.util.List<Attachments> |
getAttachments()
Get the email's attachments.
|
java.lang.String |
getBatchId()
Get the email's batch ID.
|
java.util.List<java.lang.String> |
getCategories()
Get the email's categories.
|
java.util.List<Content> |
getContent()
Get the email's content.
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomArgs()
Get the email's custom arguments.
|
Email |
getFrom()
Get the email's from address.
|
java.util.Map<java.lang.String,java.lang.String> |
getHeaders()
Get the email's headers.
|
java.lang.String |
getIpPoolId()
Get the email's IP pool ID.
|
MailSettings |
getMailSettings()
Get the email's settings.
|
java.util.List<Personalization> |
getPersonalization()
Get the email's personalizations.
|
Email |
getReplyto()
Get the email's reply to address.
|
java.util.Map<java.lang.String,java.lang.String> |
getSections()
Get the email's sections.
|
java.lang.String |
getSubject()
Get the email's subject line.
|
java.lang.String |
getTemplateId()
Get the email's template ID.
|
TrackingSettings |
getTrackingSettings()
Get the email's tracking settings.
|
int |
hashCode() |
long |
sendAt()
Get the email's send at time (Unix timestamp).
|
void |
setASM(ASM asm)
Set the email's unsubscribe handling object (ASM).
|
void |
setBatchId(java.lang.String batchId)
Set the email's batch ID.
|
void |
setFrom(Email from)
Set the email's from address.
|
void |
setIpPoolId(java.lang.String ipPoolId)
Set the email's IP pool ID.
|
void |
setMailSettings(MailSettings mailSettings)
Set the email's settings.
|
void |
setReplyTo(Email replyTo)
Set the email's reply to address.
|
void |
setSendAt(long sendAt)
Set the email's send at time (Unix timestamp).
|
void |
setSubject(java.lang.String subject)
Set the email's subject line.
|
void |
setTemplateId(java.lang.String templateId)
Set the email's template ID.
|
void |
setTrackingSettings(TrackingSettings trackingSettings)
Set the email's tracking settings.
|
public Email from
public java.lang.String subject
public java.util.List<Personalization> personalization
public java.util.List<Content> content
public java.util.List<Attachments> attachments
public java.lang.String templateId
public java.util.Map<java.lang.String,java.lang.String> sections
public java.util.Map<java.lang.String,java.lang.String> headers
public java.util.List<java.lang.String> categories
public java.util.Map<java.lang.String,java.lang.String> customArgs
public long sendAt
public java.lang.String batchId
public ASM asm
public java.lang.String ipPoolId
public MailSettings mailSettings
public TrackingSettings trackingSettings
public Email replyTo
public Email getFrom()
public void setFrom(Email from)
from
- the email's from address.public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
subject
- the email's subject line.public ASM getASM()
public void setASM(ASM asm)
asm
- the email's ASM.public java.util.List<Personalization> getPersonalization()
public void addPersonalization(Personalization personalization)
personalization
- a personalization.public java.util.List<Content> getContent()
public void addContent(Content content)
content
- content to add to this email.public java.util.List<Attachments> getAttachments()
public void addAttachments(Attachments attachments)
attachments
- attachments to add.public java.lang.String getTemplateId()
public void setTemplateId(java.lang.String templateId)
templateId
- the email's template ID.public java.util.Map<java.lang.String,java.lang.String> getSections()
public void addSection(java.lang.String key, java.lang.String value)
key
- the section's key.value
- the section's value.public java.util.Map<java.lang.String,java.lang.String> getHeaders()
public void addHeader(java.lang.String key, java.lang.String value)
key
- the header's key.value
- the header's value.public java.util.List<java.lang.String> getCategories()
public void addCategory(java.lang.String category)
category
- the category.public java.util.Map<java.lang.String,java.lang.String> getCustomArgs()
public void addCustomArg(java.lang.String key, java.lang.String value)
key
- argument's key.value
- the argument's value.public long sendAt()
public void setSendAt(long sendAt)
sendAt
- the send at time.public java.lang.String getBatchId()
public void setBatchId(java.lang.String batchId)
batchId
- the batch ID.public java.lang.String getIpPoolId()
public void setIpPoolId(java.lang.String ipPoolId)
ipPoolId
- the IP pool ID.public MailSettings getMailSettings()
public void setMailSettings(MailSettings mailSettings)
mailSettings
- the settings.public TrackingSettings getTrackingSettings()
public void setTrackingSettings(TrackingSettings trackingSettings)
trackingSettings
- the tracking settings.public Email getReplyto()
public void setReplyTo(Email replyTo)
replyTo
- the reply to address.public java.lang.String build() throws java.io.IOException
java.io.IOException
- in case of a JSON marshal error.public java.lang.String buildPretty() throws java.io.IOException
java.io.IOException
- in case of a JSON marshal error.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object