Package com.orchestranetworks.workflow
Interface MailSpec
-
public interface MailSpecThis interface provides the possibility to send emails in a workflow context.- See Also:
ProcessExecutionContext.createMailSpec()
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMailSpec.ContentTypestatic classMailSpec.NotificationTypeIndicates the notification type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidnotify(MailSpec.NotificationType recipientType, String mailAddress)Adds the email address to the recipients list.voidsendMail(Locale locale)Sends the email using the email specification.voidsetBody(String body)Sets the email body.voidsetContentType(MailSpec.ContentType contentType)Defines the content type of the email.voidsetSubject(String subject)Sets the email subject.voidsetTemplateMailId(int templateMailId)Specifies a template email (with a subject and a body).voidsetUserContext(UserReference user)Defines a specific user for the email context.
-
-
-
Method Detail
-
setSubject
void setSubject(String subject)
Sets the email subject.
- Parameters:
subject- The email subject. It can contain workflow variables that are automatically evaluated (dataContext variables or email variables).- See Also:
- Email variables.
-
setBody
void setBody(String body)
Sets the email body.
- Parameters:
body- The email body. It can contain workflow variables that are automatically evaluated (dataContext variables or email variables).- See Also:
- Email variables.
-
setTemplateMailId
void setTemplateMailId(int templateMailId)
Specifies a template email (with a subject and a body).This template can be configured in the notification messages table (in the 'Configuration' dataset of the workflow definition dataspace).
- Parameters:
templateMailId- The identifier of the email template.
-
setUserContext
void setUserContext(UserReference user)
Defines a specific user for the email context.
Dynamic variables are evaluated in the context of this user.
-
setContentType
void setContentType(MailSpec.ContentType contentType)
Defines the content type of the email.
The default value is
MailSpec.ContentType.TEXT_PLAIN.
-
notify
void notify(MailSpec.NotificationType recipientType, String mailAddress)
Adds the email address to the recipients list.
- Parameters:
recipientType- The recipient type to update.mailAddress- The email address to add as recipient.
-
sendMail
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.
- Parameters:
locale- The locale to use for the variables evaluation.- Throws:
OperationException
-
-