public interface MailSpec
ProcessExecutionContext.createMailSpec()
Modifier and Type | Interface and Description |
---|---|
static class |
MailSpec.ContentType |
static class |
MailSpec.NotificationType
Indicates the notification type.
|
Modifier and Type | Method and Description |
---|---|
void |
notify(MailSpec.NotificationType recipientType,
String mailAddress)
Adds the email address to the recipients list.
|
void |
sendMail(Locale locale)
Sends the email using the email specification.
|
void |
setBody(String body)
Sets the email body.
|
void |
setContentType(MailSpec.ContentType contentType)
Defines the content type of the email.
|
void |
setSubject(String subject)
Sets the email subject.
|
void |
setTemplateMailId(int templateMailId)
Specifies a template email (with a subject and a body).
|
void |
setUserContext(UserReference user)
Defines a specific user for the email context.
|
void setSubject(String subject)
Sets the email subject.
subject
- The email subject.
It can contain workflow variables that are automatically evaluated (dataContext variables or email
variables).void setBody(String body)
Sets the email body.
body
- The email body.
It can contain workflow variables that are automatically evaluated (dataContext variables or email
variables).void setTemplateMailId(int templateMailId)
This template can be configured in the notification messages table (in the 'Configuration' dataset of the workflow definition dataspace).
templateMailId
- The identifier of the email template.void setUserContext(UserReference user)
Defines a specific user for the email context.
Dynamic variables are evaluated in the context of this user.
void setContentType(MailSpec.ContentType contentType)
Defines the content type of the email.
The default value is MailSpec.ContentType.TEXT_PLAIN
.
void notify(MailSpec.NotificationType recipientType, String mailAddress)
Adds the email address to the recipients list.
recipientType
- The recipient type to update.mailAddress
- The email address to add as recipient.void sendMail(Locale locale) throws OperationException
Sends the email using the email specification.
If a template email identifier is specified, the email is built and sent. Else, the email is sent with the specified subject and body.
locale
- The locale to use for the variables evaluation.OperationException