public interface EmailerAPI
processQueuedEmails() method.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
loadContentText(SendingMessage sendingMessage)
Loads content text for given message.
|
void |
migrateAttachmentsToFileStorage(java.util.List<SendingAttachment> attachments)
Migrate list of existing email attachments to be stored in file storage, in a single transaction.
|
void |
migrateEmailsToFileStorage(java.util.List<SendingMessage> messages)
Migrate list of existing messages to be stored in file storage, in a single transaction.
|
java.lang.String |
processQueuedEmails()
Send emails added to the queue.
|
void |
sendEmail(EmailInfo info)
Send email synchronously.
|
void |
sendEmail(java.lang.String address,
java.lang.String caption,
java.lang.String body,
EmailAttachment... attachments)
Deprecated.
|
void |
sendEmail(java.lang.String address,
java.lang.String caption,
java.lang.String body,
java.lang.String bodyContentType,
EmailAttachment... attachments)
Deprecated.
|
java.util.List<SendingMessage> |
sendEmailAsync(EmailInfo info)
Send email asynchronously.
|
java.util.List<SendingMessage> |
sendEmailAsync(EmailInfo info,
java.lang.Integer attemptsCount,
java.util.Date deadline)
Send email asynchronously, with limited number of attempts.
|
void |
updateSession()
Updates
Properties for JavaMail Session |
static final java.lang.String NAME
@Deprecated
void sendEmail(java.lang.String address,
java.lang.String caption,
java.lang.String body,
EmailAttachment... attachments)
throws EmailException
sendEmail(EmailInfo) instead.
Send email synchronously.
address - comma or semicolon separated list of addressescaption - email subjectbody - email bodyattachments - email attachmentsEmailException - in case of any errors@Deprecated
void sendEmail(java.lang.String address,
java.lang.String caption,
java.lang.String body,
java.lang.String bodyContentType,
EmailAttachment... attachments)
throws EmailException
sendEmail(EmailInfo) instead.
Send email synchronously.
address - comma or semicolon separated list of addressescaption - email subjectbody - email bodybodyContentType - email body like "text/plain; charset=UTF-8" or "text/html; charset=UTF-8", etcattachments - email attachmentsEmailException - in case of any errorsvoid sendEmail(EmailInfo info) throws EmailException
info - email detailsEmailException - in case of any errorsjava.util.List<SendingMessage> sendEmailAsync(EmailInfo info, @Nullable java.lang.Integer attemptsCount, @Nullable java.util.Date deadline)
info - email detailsattemptsCount - count of attempts to send (1 attempt per scheduler tick). If not specified,
EmailerConfig.getDefaultSendingAttemptsCount() is useddeadline - Emailer tries to send message till deadline.
If deadline has come and message has not been sent, status of this message is changed to
SendingStatus.NOTSENTSendingMessagesjava.util.List<SendingMessage> sendEmailAsync(EmailInfo info)
This method creates a list of SendingMessage instances, saves it to the database and returns immediately.
The actual sending is performed by the processQueuedEmails() method which should be invoked by a
scheduled task.
info - email detailsSendingMessagesjava.lang.String processQueuedEmails()
This method should be called periodically from a scheduled task.
void migrateEmailsToFileStorage(java.util.List<SendingMessage> messages)
void migrateAttachmentsToFileStorage(java.util.List<SendingAttachment> attachments)
java.lang.String loadContentText(SendingMessage sendingMessage)
void updateSession()
Properties for JavaMail Session