19 package org.turro.mail.message;
21 import java.io.StringWriter;
22 import org.turro.mail.provider.MailProvider;
23 import org.turro.mail.provider.MailRecipient;
24 import org.turro.marker.ElephantMarker;
25 import org.turro.plugin.contacts.IContact;
26 import org.turro.string.Strings;
35 private boolean processLiveLinks =
true;
42 this.processLiveLinks = processLiveLinks;
50 if(contact !=
null && contact.
isWebUser()) {
64 StringWriter sw =
new StringWriter();
65 marker.
put(
"message",
this);
67 String msg = sw.toString();
68 if(processLiveLinks && !recipient.
isEmpty()) {
77 return Strings.isBlank(
template) ?
"default-mail" :
template;
void setMessage(ElephantMarker marker, String email, String name)
void setProcessLiveLinks(boolean processLiveLinks)
MailMessageTemplate(MailProvider provider)
void setMessage(ElephantMarker marker, String template, MailRecipient recipient)
void setMessage(ElephantMarker marker, String template, IContact contact)
void setMessage(ElephantMarker marker, IContact contact)
void setMessage(ElephantMarker marker, String template, String email, String name)
static MailMessageTemplate of(MailProvider provider)
String getMailTemplate(String template)
void setRoot(String root)
final MailProvider provider
static String processLinks(IContact contact, String message)
static String processUser(IContact contact, String message)
static String processImgWidth(String message)
static MailRecipient of(String value)
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)