public class Composer extends Object
Modifier and Type | Field and Description |
---|---|
protected FreemarkerEngine |
engine |
protected Mailer |
mailer |
protected ConcurrentMap<String,URL> |
urls |
Modifier and Type | Method and Description |
---|---|
protected Mailer |
createMailer() |
FreemarkerEngine |
getEngine() |
Mailer |
getMailer() |
Mailer.Message |
newHtmlMessage(String templateContent,
Object ctx) |
Mailer.Message |
newHtmlMessage(URL template,
Object ctx) |
Mailer.Message |
newMessage() |
Mailer.Message |
newMixedMessage(String templateContent,
Object ctx,
String textType,
List<Blob> attachments) |
Mailer.Message |
newTextMessage(String templateContent,
Object ctx) |
Mailer.Message |
newTextMessage(URL template,
Object ctx) |
void |
registerTemplate(URL url) |
String |
render(String templateContent,
Object ctx) |
void |
render(String template,
Object ctx,
Writer writer) |
String |
render(URL template,
Object ctx) |
void |
render(URL template,
Object ctx,
Writer writer) |
void |
unregisterAllTemplates() |
void |
unregisterTemplate(URL url) |
protected final FreemarkerEngine engine
protected final ConcurrentMap<String,URL> urls
protected Mailer createMailer()
public void registerTemplate(URL url)
public void unregisterTemplate(URL url)
public void unregisterAllTemplates()
public FreemarkerEngine getEngine()
public void render(String template, Object ctx, Writer writer) throws RenderingException
RenderingException
public void render(URL template, Object ctx, Writer writer) throws RenderingException
RenderingException
public String render(URL template, Object ctx) throws RenderingException
RenderingException
public String render(String templateContent, Object ctx) throws freemarker.template.TemplateException, IOException
freemarker.template.TemplateException
IOException
public Mailer.Message newMessage()
public Mailer.Message newTextMessage(URL template, Object ctx) throws RenderingException, javax.mail.MessagingException
RenderingException
javax.mail.MessagingException
public Mailer.Message newTextMessage(String templateContent, Object ctx) throws RenderingException, javax.mail.MessagingException, freemarker.template.TemplateException, IOException
RenderingException
javax.mail.MessagingException
freemarker.template.TemplateException
IOException
public Mailer.Message newHtmlMessage(URL template, Object ctx) throws RenderingException, javax.mail.MessagingException
RenderingException
javax.mail.MessagingException
public Mailer.Message newHtmlMessage(String templateContent, Object ctx) throws javax.mail.MessagingException, freemarker.template.TemplateException, IOException
javax.mail.MessagingException
freemarker.template.TemplateException
IOException
public Mailer.Message newMixedMessage(String templateContent, Object ctx, String textType, List<Blob> attachments) throws freemarker.template.TemplateException, IOException, javax.mail.MessagingException
freemarker.template.TemplateException
IOException
javax.mail.MessagingException
Copyright © 2018 Nuxeo. All rights reserved.