public class EmailFactoryImpl extends Object implements EmailFactory
EmailFactory.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENCODING |
static String |
ERROR_KEY_TEMPLATE_CONFIG_MISSING |
protected freemarker.template.Configuration |
freeMarkerConfig |
static String |
LOG_KEY_MIME_MSG_CREATED |
static String |
LOG_KEY_PROCESSING_EMAIL_TEMPLATE |
protected org.springframework.mail.javamail.JavaMailSender |
mailSender |
protected String |
templateEncoding |
protected String |
templatePrefix |
protected String |
templateSuffix |
| Constructor and Description |
|---|
EmailFactoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected javax.mail.internet.MimeMessage |
createMessage(String from,
String[] to,
String[] cc,
String[] bcc,
String replyTo,
String subject,
String body,
boolean html,
File... attachments) |
Email |
getEmail(String from,
String[] to,
String[] cc,
String[] bcc,
String subject,
String body,
boolean html,
File... attachments)
Creates a new
Email. |
Email |
getEmail(String from,
String[] to,
String[] cc,
String[] bcc,
String subject,
String templateName,
Object templateModel,
boolean html,
File... attachments)
Creates a new
Email. |
Email |
getEmail(String from,
String[] to,
String[] cc,
String[] bcc,
String replyTo,
String subject,
String body,
boolean html,
File... attachments)
Creates a new
Email. |
Email |
getEmail(String from,
String[] to,
String[] cc,
String[] bcc,
String replyTo,
String subject,
String templateName,
Object templateModel,
boolean html,
File... attachments)
Creates a new
Email. |
protected String |
processTemplate(String templateName,
Object templateModel) |
void |
setFreeMarkerConfig(freemarker.template.Configuration freeMarkerConfig) |
void |
setMailSender(org.springframework.mail.javamail.JavaMailSender mailSender) |
void |
setTemplateEncoding(String templateEncoding) |
void |
setTemplatePrefix(String templatePrefix) |
void |
setTemplateSuffix(String templateSuffix) |
public static final String DEFAULT_ENCODING
public static final String LOG_KEY_MIME_MSG_CREATED
public static final String LOG_KEY_PROCESSING_EMAIL_TEMPLATE
public static final String ERROR_KEY_TEMPLATE_CONFIG_MISSING
protected org.springframework.mail.javamail.JavaMailSender mailSender
protected freemarker.template.Configuration freeMarkerConfig
protected String templatePrefix
protected String templateSuffix
protected String templateEncoding
public void setMailSender(org.springframework.mail.javamail.JavaMailSender mailSender)
public void setFreeMarkerConfig(freemarker.template.Configuration freeMarkerConfig)
public void setTemplatePrefix(String templatePrefix)
public void setTemplateSuffix(String templateSuffix)
public void setTemplateEncoding(String templateEncoding)
public Email getEmail(String from, String[] to, String[] cc, String[] bcc, String subject, String body, boolean html, File... attachments) throws EmailException
EmailFactoryEmail.getEmail in interface EmailFactoryfrom - the sender's addressto - the recipients' addresses (optional)cc - the CC recipients' addresses (optional)bcc - the BCC recipients' addresses (optional)subject - the subject of the emailbody - the text body of the emailhtml - if the body is in HTML formatattachments - the attachments to add to the emailEmailExceptionpublic Email getEmail(String from, String[] to, String[] cc, String[] bcc, String replyTo, String subject, String body, boolean html, File... attachments) throws EmailException
EmailFactoryEmail.getEmail in interface EmailFactoryfrom - the sender's addressto - the recipients' addresses (optional)cc - the CC recipients' addresses (optional)bcc - the BCC recipients' addresses (optional)replyTo - the address to reply tosubject - the subject of the emailbody - the text body of the emailhtml - if the body is in HTML formatEmailExceptionpublic Email getEmail(String from, String[] to, String[] cc, String[] bcc, String subject, String templateName, Object templateModel, boolean html, File... attachments) throws EmailException
EmailFactoryEmail.getEmail in interface EmailFactoryfrom - the sender's addressto - the recipients' addresses (optional)cc - the CC recipients' addresses (optional)bcc - the BCC recipients' addresses (optional)subject - the subject of the emailtemplateName - the template name of the emailtemplateModel - the template model of the emailhtml - if the body is in HTML formatEmailExceptionpublic Email getEmail(String from, String[] to, String[] cc, String[] bcc, String replyTo, String subject, String templateName, Object templateModel, boolean html, File... attachments) throws EmailException
EmailFactoryEmail.getEmail in interface EmailFactoryfrom - the sender's addressto - the recipients' addresses (optional)cc - the CC recipients' addresses (optional)bcc - the BCC recipients' addresses (optional)replyTo - the address to reply tosubject - the subject of the emailtemplateName - the template name of the emailtemplateModel - the template model of the emailhtml - if the body is in HTML formatEmailExceptionprotected javax.mail.internet.MimeMessage createMessage(String from, String[] to, String[] cc, String[] bcc, String replyTo, String subject, String body, boolean html, File... attachments) throws EmailException
EmailExceptionprotected String processTemplate(String templateName, Object templateModel) throws EmailException
EmailExceptionCopyright © 2020 CrafterCMS. All rights reserved.