protected void setCharset(Email email, String charSetStr) { if (charset != null) { email.setCharset(charSetStr); } }
protected void setSubject(Email email, String subject) { email.setSubject(subject != null ? subject : ""); }
public void _apply(Email email) throws EmailException { email.setMailSession(helper.getMailSession()); } }
protected HtmlEmail createHtmlEmail(String text, String html) { HtmlEmail email = new HtmlEmail(); try { email.setHtmlMsg(html); if (text != null) { // for email clients that don't support html email.setTextMsg(text); } return email; } catch (EmailException e) { throw new ActivitiException("Could not create HTML email", e); } }
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw new ActivitiException("Could not create text-only email", e); } }
@Override public void doSetServerParameter(MultiPartEmail multiPartEmail, String smtpHost, Integer smtpPort, Boolean smtpSsl, Boolean smtpStartTLS, Boolean smtpStartTLSRequired, String smtpUser, String smtpPassword, Boolean smtpDebug) { // /set config params: multiPartEmail.setHostName(smtpHost); multiPartEmail.setSmtpPort(smtpPort); multiPartEmail.setSSLOnConnect(smtpSsl); multiPartEmail.setStartTLSEnabled(smtpStartTLS); multiPartEmail.setStartTLSRequired(smtpStartTLSRequired); if (smtpUser != null) { multiPartEmail.setAuthentication(smtpUser, smtpPassword); } multiPartEmail.setDebug(smtpDebug); }
protected MultiPartEmail createMultiPartEmail(String text) { MultiPartEmail email = new MultiPartEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw new ActivitiException("Could not create text-only email", e); } }
@Signature public PHtmlEmail setHtmlMessage(String value) throws EmailException { htmlEmail.setHtmlMsg(value); return this; }
@Signature public PHtmlEmail setFrom(String email, String name) throws EmailException { htmlEmail.setFrom(email, name); return this; }
@Signature public PHtmlEmail setTextMessage(String value) throws EmailException { htmlEmail.setTextMsg(value); return this; }
@Signature public PHtmlEmail setSubject(String subject) { htmlEmail.setSubject(subject); return this; }
protected void addCc(Email email, String cc) { String[] ccs = splitAndTrim(cc); if (ccs != null) { for (String c : ccs) { try { email.addCc(c); } catch (EmailException e) { throw new ActivitiException("Could not add " + c + " as cc recipient", e); } } } }
protected void addBcc(Email email, String bcc) { String[] bccs = splitAndTrim(bcc); if (bccs != null) { for (String b : bccs) { try { email.addBcc(b); } catch (EmailException e) { throw new ActivitiException("Could not add " + b + " as bcc recipient", e); } } } }
@Signature public PHtmlEmail setCharset(String charset) { htmlEmail.setCharset(charset); return this; }
protected void setEmailSession(Email email, String mailSessionJndi) { try { email.setMailSessionFromJNDI(mailSessionJndi); } catch (NamingException e) { throw new ActivitiException("Could not send email: Incorrect JNDI configuration", e); } }
@Signature public PHtmlEmail setMessage(String value) throws EmailException { htmlEmail.setMsg(value); return this; }
@Signature public PHtmlEmail setHeaders(Map<String, String> map) { htmlEmail.setHeaders(map); return this; }
@Signature public PHtmlEmail setBcc(List<InternetAddress> addresses) throws EmailException { htmlEmail.setBcc(addresses); return this; }
@Signature public PHtmlEmail setFrom(String email, String name, String charset) throws EmailException { htmlEmail.setFrom(email, name, charset); return this; }
@Signature public PHtmlEmail setFrom(String email) throws EmailException { htmlEmail.setFrom(email); return this; }