@Service(value="cuba_EmailService") public class EmailServiceBean extends java.lang.Object implements EmailService
NAME
Constructor and Description |
---|
EmailServiceBean() |
Modifier and Type | Method and Description |
---|---|
boolean |
isFileStorageUsed() |
java.lang.String |
loadContentText(SendingMessage sendingMessage)
Load content text for given message.
|
void |
sendEmail(EmailInfo info)
Send email synchronously.
|
void |
sendEmail(java.lang.String address,
java.lang.String caption,
java.lang.String body,
EmailAttachment... attachment)
Send email synchronously.
|
void |
sendEmailAsync(EmailInfo info)
Send email asynchronously.
|
void |
sendEmailAsync(EmailInfo info,
java.lang.Integer attemptsCount,
java.util.Date deadline)
Send email asynchronously, with limited number of attempts.
|
public void sendEmail(java.lang.String address, java.lang.String caption, java.lang.String body, EmailAttachment... attachment) throws EmailException
EmailService
sendEmail
in interface EmailService
address
- comma or semicolon separated list of addressescaption
- email subjectbody
- email bodyattachment
- email attachmentsEmailException
- in case of any errorspublic void sendEmail(EmailInfo info) throws EmailException
EmailService
sendEmail
in interface EmailService
info
- email detailsEmailException
- in case of any errorspublic void sendEmailAsync(EmailInfo info, java.lang.Integer attemptsCount, java.util.Date deadline)
EmailService
The actual sending is performed by invoking the EmailerAPI.processQueuedEmails()
(e.g. from a scheduled task).
sendEmailAsync
in interface EmailService
info
- email detailsattemptsCount
- count of attempts to send (1 attempt = 1 emailer cron tick)deadline
- 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.NOTSENT
public void sendEmailAsync(EmailInfo info)
EmailService
The actual sending is performed by invoking the EmailerAPI.processQueuedEmails()
(e.g. from a scheduled task).
sendEmailAsync
in interface EmailService
info
- email detailspublic java.lang.String loadContentText(SendingMessage sendingMessage)
EmailService
loadContentText
in interface EmailService
public boolean isFileStorageUsed()
isFileStorageUsed
in interface EmailService