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