public abstract class MailService extends JahiaService
settingsBean| Constructor and Description |
|---|
MailService() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
defaultRecipient() |
abstract String |
defaultSender() |
static MailService |
getInstance()
Returns an instance of the mail service.
|
abstract MailSettings |
getSettings()
Returns mail configuration settings.
|
boolean |
isEnabled()
Returns
true if the mail service is enabled and settings
are valid. |
static boolean |
isValidEmailAddress(String address,
boolean allowMultiple)
Checks, if the specified string is a valid e-mail address according to
RFC822.
|
abstract boolean |
sendHtmlMessage(String from,
String to,
String cc,
String bcc,
String subject,
String message)
Send message in the HTML format to the desired destination with cc and bcc option.
|
abstract void |
sendMessage(MailMessage message)
Send provided mail message.
|
void |
sendMessage(org.springframework.mail.javamail.MimeMessagePreparator mimeMessagePreparator) |
abstract boolean |
sendMessage(String message)
Send message to the default Jahia settings defined in the jahia.properties
file.
|
abstract boolean |
sendMessage(String to,
String message)
Send message to the desired destination.
|
abstract boolean |
sendMessage(String from,
String to,
String message)
Send message to the desired destination.
|
abstract boolean |
sendMessage(String from,
String to,
String cc,
String bcc,
String subject,
String message)
Send message to the desired destination with cc and bcc option.
|
abstract void |
sendMessage(String from,
String to,
String cc,
String bcc,
String subject,
String textBody,
String htmlBody)
Send message to the desired destination with cc and bcc option.
|
abstract void |
sendMessageWithTemplate(MailMessage message,
String template,
Map<String,Object> boundObjects,
Locale locale,
String templatePackageName)
Send provided mail message using specified template that is responsible for producing mail subject and body.
|
abstract void |
sendMessageWithTemplate(String template,
Map<String,Object> boundObjects,
String toMail,
String fromMail,
String ccList,
String bcclist,
Locale locale,
String templatePackageName) |
abstract void |
store(MailSettings cfg)
Persists the changes in mail server connection configuration.
|
getSettingsBean, setSettingsBean, start, stoppublic static MailService getInstance()
public abstract boolean sendMessage(String message)
message - The message to sendpublic abstract boolean sendMessage(String to, String message)
to - The message destination.message - The message to send.public abstract boolean sendMessage(String from, String to, String message)
from - The message senderto - The message destination.message - The message to send.public abstract boolean sendMessage(String from, String to, String cc, String bcc, String subject, String message)
from - The message senderto - The message destination.cc - The message copy destination.bcc - The message copy blind destination.subject - The message subject.message - The message to send.public abstract void sendMessage(String from, String to, String cc, String bcc, String subject, String textBody, String htmlBody)
from - The message senderto - The message destination.cc - The message copy destination.bcc - The message copy blind destination.subject - The message subject.textBody - The text message to sendhtmlBody - The HTML message to sendpublic abstract boolean sendHtmlMessage(String from, String to, String cc, String bcc, String subject, String message)
from - The message senderto - The message destination.cc - The message copy destination.bcc - The message copy blind destination.subject - The message subject.message - The message to send.public abstract String defaultRecipient()
public abstract String defaultSender()
public boolean isEnabled()
true if the mail service is enabled and settings
are valid.true if the mail service is enabled and settings
are validpublic abstract MailSettings getSettings()
public static boolean isValidEmailAddress(String address, boolean allowMultiple)
address - the address to be checkedallowMultiple - are multiple addresses allowed (separated by comma)true, if the specified string is a valid e-mail
address according to RFC822public void sendMessage(org.springframework.mail.javamail.MimeMessagePreparator mimeMessagePreparator)
public abstract void sendMessageWithTemplate(String template, Map<String,Object> boundObjects, String toMail, String fromMail, String ccList, String bcclist, Locale locale, String templatePackageName) throws javax.jcr.RepositoryException, ScriptException
javax.jcr.RepositoryExceptionScriptExceptionpublic abstract void store(MailSettings cfg)
cfg - the new mail settings to be storedpublic abstract void sendMessage(MailMessage message)
message - the mail message to be sentpublic abstract void sendMessageWithTemplate(MailMessage message, String template, Map<String,Object> boundObjects, Locale locale, String templatePackageName) throws ScriptException
message - the mail message to be senttemplate - the template script pathboundObjects - the objects for the script enginelocale - the locale to find the appropriate template scripttemplatePackageName - the module ID to lookup i18n resources fromScriptException - in case of an error executing template scriptCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.