public class MailManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MailManager.EmailContentType |
static interface |
MailManager.PlaceholderProvider |
Modifier and Type | Method and Description |
---|---|
void |
deleteMessages(java.util.List<GUID> messageIDs)
Deletes all given messages at the server if not sent already.
|
CumulusSession |
getCumulusSession()
Returns the CumulusSession for this MailManager.
|
static MailManager |
getInstance(Server server)
Returns the singleton instance of the MailManager for the given server.
|
MailServerConfigurations |
getMailServerConfigurations()
Returns all mail server configurations.
|
java.util.List<MailMessage> |
getQueueInformation()
Returns the queue of the messages at the server.
|
Server |
getServer()
Returns the server instance of this mail manager.
|
void |
sendMessage(int languageID,
GUID mailClassID,
java.lang.String templateName,
MailManager.PlaceholderProvider placeholderProvider,
java.lang.String from,
java.lang.String recipients,
java.lang.String ccRecipients,
java.lang.String bccRecipients,
java.util.Collection<Asset> assetsToAttach)
Sends a message dynamically constructed from an email template.
|
void |
sendMessage(java.lang.String from,
java.lang.String recipients,
java.lang.String ccRecipients,
java.lang.String bccRecipients,
java.lang.String subject,
java.lang.String bodyText,
java.util.Collection<Asset> assetsToAttach)
Sends a message.
|
void |
sendNotificationMessage(MailServerConfiguration.NotificationsLevel level,
java.lang.String message)
Sends a notification message to the administrator of the cumulus server.
|
void |
sendTestMessage(int languageID,
GUID mailClassID,
java.lang.String templateName,
MailManager.PlaceholderProvider placeholderProvider,
java.lang.String from,
java.lang.String recipients,
java.lang.String ccRecipients,
java.lang.String bccRecipients,
java.util.Collection<Asset> assetsToAttach)
Sends a test message dynamically constructed from an email template.
|
java.util.List<MailAddress> |
validateAddresses(java.lang.String addresses)
Converts the email addresses in the given string into a list of parsed email addresses.
|
public static MailManager getInstance(Server server)
server
- server providing the mail infrastructurepublic Server getServer()
public CumulusSession getCumulusSession()
public void sendTestMessage(int languageID, GUID mailClassID, java.lang.String templateName, MailManager.PlaceholderProvider placeholderProvider, java.lang.String from, java.lang.String recipients, java.lang.String ccRecipients, java.lang.String bccRecipients, java.util.Collection<Asset> assetsToAttach)
languageID
- the language to use for the emailmailClassID
- ID of the email class to read the template fromtemplateName
- name of the template within the email class, or null
if the default template should be selected automaticallyplaceholderProvider
- provider for additional placeholder values or null
if no additional placeholder should be resolvedfrom
- sender or null if not applicablerecipients
- required list of recipientsccRecipients
- list of cc-recipients or nullbccRecipients
- list of bcc-recipients or nullassetsToAttach
- list of assets to attach to the message or nullpublic void sendMessage(int languageID, GUID mailClassID, java.lang.String templateName, MailManager.PlaceholderProvider placeholderProvider, java.lang.String from, java.lang.String recipients, java.lang.String ccRecipients, java.lang.String bccRecipients, java.util.Collection<Asset> assetsToAttach)
languageID
- the language to use for the emailmailClassID
- ID of the email class to read the template fromtemplateName
- name of the template within the email class, or null
if the default template should be selected automaticallyplaceholderProvider
- provider for additional placeholder values or null
if no additional placeholder should be resolvedfrom
- sender or null if not applicablerecipients
- required list of recipientsccRecipients
- list of cc-recipients or nullbccRecipients
- list of bcc-recipients or nullassetsToAttach
- list of assets to attach to the message or nullpublic void sendMessage(java.lang.String from, java.lang.String recipients, java.lang.String ccRecipients, java.lang.String bccRecipients, java.lang.String subject, java.lang.String bodyText, java.util.Collection<Asset> assetsToAttach) throws CumulusException
from
- sender or null if not applicablerecipients
- required list of recipientsccRecipients
- list of cc-recipients or nullbccRecipients
- list of bcc-recipients or nullsubject
- subject of the message or nullbodyText
- body of the message or nullassetsToAttach
- list of assets to attach to the message or nullCumulusException
- in case of an errorpublic void sendNotificationMessage(MailServerConfiguration.NotificationsLevel level, java.lang.String message) throws CumulusException
level
- level of this messagemessage
- message textCumulusException
- if some error happens while communicating with the cumulus serverpublic java.util.List<MailMessage> getQueueInformation()
PredefinedPermissions.SERVER_PERMISSION_MAIL_ADMIN
permission.public java.util.List<MailAddress> validateAddresses(java.lang.String addresses) throws CumulusException
addresses
- comma or semicolon separated list of email addresses using RFC822 formatCumulusException
- in case of an invalid part for one of the email addressespublic void deleteMessages(java.util.List<GUID> messageIDs)
PredefinedPermissions.SERVER_PERMISSION_MAIL_ADMIN
permission.messageIDs
- message IDs of the messages to deletepublic MailServerConfigurations getMailServerConfigurations() throws CumulusException
PredefinedPermissions.SERVER_PERMISSION_MAIL_ADMIN
permission.CumulusException
- in case of an errorwww.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.