public class EmailInfo
extends java.lang.Object
implements java.io.Serializable
EmailInfoBuilder
for more information.EmailService
,
EmailInfoBuilder
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
HTML_CONTENT_TYPE |
static java.lang.String |
TEXT_CONTENT_TYPE |
Constructor and Description |
---|
EmailInfo(java.lang.String addresses,
java.lang.String caption,
java.lang.String body)
Deprecated.
|
EmailInfo(java.lang.String addresses,
java.lang.String caption,
java.lang.String body,
java.lang.String bodyContentType)
Deprecated.
|
EmailInfo(java.lang.String addresses,
java.lang.String caption,
java.lang.String from,
java.lang.String body,
EmailAttachment... attachments)
Deprecated.
|
EmailInfo(java.lang.String addresses,
java.lang.String caption,
java.lang.String from,
java.lang.String templatePath,
java.util.Map<java.lang.String,java.io.Serializable> templateParameters,
EmailAttachment... attachments)
Deprecated.
|
EmailInfo(java.lang.String addresses,
java.lang.String caption,
java.lang.String from,
java.lang.String body,
java.lang.String bodyContentType,
EmailAttachment... attachments)
Deprecated.
|
EmailInfo(java.lang.String addresses,
java.lang.String caption,
java.lang.String from,
java.lang.String bodyContentType,
java.lang.String templatePath,
java.util.Map<java.lang.String,java.io.Serializable> templateParameters,
EmailAttachment... attachments)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String name,
java.lang.String value) |
java.lang.String |
getAddresses() |
EmailAttachment[] |
getAttachments() |
java.lang.String |
getBcc() |
java.lang.String |
getBody() |
java.lang.String |
getBodyContentType() |
java.lang.String |
getCaption() |
java.lang.String |
getCc() |
java.lang.String |
getFrom() |
java.util.List<EmailHeader> |
getHeaders() |
java.util.Map<java.lang.String,java.io.Serializable> |
getTemplateParameters() |
java.lang.String |
getTemplatePath() |
boolean |
isSendInOneMessage() |
void |
setAddresses(java.lang.String addresses) |
void |
setAttachments(EmailAttachment[] attachments) |
void |
setBcc(java.lang.String bcc)
Result of this method call (i.e., setting addresses of the email BCC field) is ignored during the message creation
if
isSendInOneMessage() returns false (default behaviour),
because, in this case, the message is generated for each of the recipients separately. |
void |
setBody(java.lang.String body) |
void |
setBodyContentType(java.lang.String bodyContentType) |
void |
setCaption(java.lang.String caption) |
void |
setCc(java.lang.String cc)
Result of this method call (i.e., setting addresses of the email CC field) is ignored during the message creation if
isSendInOneMessage() returns false (default behaviour),
because, in this case, the message is generated for each of the recipients separately. |
void |
setFrom(java.lang.String from) |
void |
setHeaders(java.util.List<EmailHeader> headers) |
void |
setSendInOneMessage(boolean sendInOneMessage) |
void |
setTemplateParameters(java.util.Map<java.lang.String,java.io.Serializable> templateParameters) |
void |
setTemplatePath(java.lang.String templatePath) |
public static final java.lang.String HTML_CONTENT_TYPE
public static final java.lang.String TEXT_CONTENT_TYPE
@Deprecated public EmailInfo(java.lang.String addresses, java.lang.String caption, @Nullable java.lang.String from, java.lang.String templatePath, java.util.Map<java.lang.String,java.io.Serializable> templateParameters, EmailAttachment... attachments)
EmailInfoBuilder
instead.
Constructor. Example usage:
EmailInfo emailInfo = new EmailInfo(
"john.doe@company.com,jane.roe@company.com",
"Company news",
"do-not-reply@company.com",
"com/company/sample/email_templates/news.txt",
Collections.singletonMap("some_var", some_value)
);
If you want to set content body type you can use
EmailInfo(String, String, String, String, String, Map, EmailAttachment...)
instead or use setBodyContentType()
method.
addresses
- comma or semicolon separated list of addressescaption
- email subjectfrom
- "from" address. If null, a default provided by cuba.email.fromAddress
app property is used.templatePath
- path to a Freemarker template which is used to create the message body. The template
is loaded through Resources
in the core module.templateParameters
- map of parameters to be passed to the templateattachments
- email attachments. Omit this parameter if there are no attachments.@Deprecated public EmailInfo(java.lang.String addresses, java.lang.String caption, @Nullable java.lang.String from, java.lang.String bodyContentType, java.lang.String templatePath, java.util.Map<java.lang.String,java.io.Serializable> templateParameters, EmailAttachment... attachments)
EmailInfoBuilder
instead.
Constructor. Example usage:
EmailInfo emailInfo = new EmailInfo(
"john.doe@company.com,jane.roe@company.com",
"Company news",
"do-not-reply@company.com",
EmailInfo.HTML_CONTENT_TYPE,
"com/company/sample/email_templates/news.txt",
Collections.singletonMap("some_var", some_value)
);
addresses
- comma or semicolon separated list of addressescaption
- email subjectfrom
- "from" address. If null, a default provided by cuba.email.fromAddress
app property is used.bodyContentType
- email body like "text/plain; charset=UTF-8" or "text/html; charset=UTF-8", etctemplatePath
- path to a Freemarker template which is used to create the message body. The template
is loaded through Resources
in the core module.templateParameters
- map of parameters to be passed to the templateattachments
- email attachments. Omit this parameter if there are no attachments.@Deprecated public EmailInfo(java.lang.String addresses, java.lang.String caption, @Nullable java.lang.String from, java.lang.String body, EmailAttachment... attachments)
EmailInfoBuilder
instead.
Constructor.
EmailInfo emailInfo = new EmailInfo(
"john.doe@company.com,jane.roe@company.com",
"Company news",
null,
"Some content"
);
If you want to set content body type you can use
EmailInfo(String, String, String, String, String, EmailAttachment...)
instead or use setBodyContentType()
method.
addresses
- comma or semicolon separated list of addressescaption
- email subjectfrom
- "from" address. If null, a default provided by cuba.email.fromAddress
app property is used.body
- email bodyattachments
- email attachments. Omit this parameter if there are no attachments.@Deprecated public EmailInfo(java.lang.String addresses, java.lang.String caption, @Nullable java.lang.String from, java.lang.String body, java.lang.String bodyContentType, EmailAttachment... attachments)
EmailInfoBuilder
instead.
Constructor.
EmailInfo emailInfo = new EmailInfo(
"john.doe@company.com,jane.roe@company.com",
"Company news",
null,
"Some content",
EmailInfo.TEXT_CONTENT_TYPE
);
addresses
- comma or semicolon separated list of addressescaption
- email subjectfrom
- "from" address. If null, a default provided by cuba.email.fromAddress
app property is used.body
- email bodybodyContentType
- email body like "text/plain; charset=UTF-8" or "text/html; charset=UTF-8", etcattachments
- email attachments. Omit this parameter if there are no attachments.@Deprecated public EmailInfo(java.lang.String addresses, java.lang.String caption, java.lang.String body)
EmailInfoBuilder
instead.
Constructor. The "from" address is taken from the cuba.email.fromAddress
app property.
EmailInfo emailInfo = new EmailInfo(
"john.doe@company.com,jane.roe@company.com",
"Company news",
"Some content"
);
If you want to set content body type you can use EmailInfo(String, String, String, String)
instead or
use setBodyContentType()
method.
addresses
- comma or semicolon separated list of addressescaption
- email subjectbody
- email body@Deprecated public EmailInfo(java.lang.String addresses, java.lang.String caption, java.lang.String body, java.lang.String bodyContentType)
EmailInfoBuilder
instead.
Constructor. The "from" address is taken from the cuba.email.fromAddress
app property.
EmailInfo emailInfo = new EmailInfo(
"john.doe@company.com,jane.roe@company.com",
"Company news",
"Some content",
EmailInfo.TEXT_CONTENT_TYPE"
);
addresses
- comma or semicolon separated list of addressescaption
- email subjectbody
- email bodybodyContentType
- email body like "text/plain; charset=UTF-8" or "text/html; charset=UTF-8", etcpublic java.lang.String getAddresses()
public void setAddresses(java.lang.String addresses)
public java.lang.String getCaption()
public void setCaption(java.lang.String caption)
public java.lang.String getTemplatePath()
public void setTemplatePath(java.lang.String templatePath)
public java.lang.String getBody()
public void setBody(java.lang.String body)
public EmailAttachment[] getAttachments()
public void setAttachments(EmailAttachment[] attachments)
public java.util.Map<java.lang.String,java.io.Serializable> getTemplateParameters()
public void setTemplateParameters(java.util.Map<java.lang.String,java.io.Serializable> templateParameters)
public java.lang.String getFrom()
public void setFrom(java.lang.String from)
public java.util.List<EmailHeader> getHeaders()
public void setHeaders(java.util.List<EmailHeader> headers)
public void addHeader(java.lang.String name, java.lang.String value)
public java.lang.String getBodyContentType()
public void setBodyContentType(java.lang.String bodyContentType)
public java.lang.String getCc()
public void setCc(java.lang.String cc)
isSendInOneMessage()
returns false
(default behaviour),
because, in this case, the message is generated for each of the recipients separately.public java.lang.String getBcc()
public void setBcc(java.lang.String bcc)
isSendInOneMessage()
returns false
(default behaviour),
because, in this case, the message is generated for each of the recipients separately.public boolean isSendInOneMessage()
public void setSendInOneMessage(boolean sendInOneMessage)