Email Activity
- Last UpdatedFeb 13, 2025
- 11 minute read
Activity description
The Email Activity can be used to send an email to a selected set of actors. The actors(s) can be selected by building a query. The workflow engine evaluates this query and sends an email to all the actors resulting from the query. If no actor is selected the email will be sent to all the actors. The subject and body of the email can be customized by appending the resource properties available.
Adding Email attachments using Contents and Variables:
Steps to add Email attachments using Workflow Variables:
To set email attachments using variable, prefix the variable name with "^[ActivityName]".
For example, for the activity named "EmailNotification", name the variable as "^EmailNotificationattachments". Set the value for the variable with physical paths to the file. Use semi-colon as separator to set multiple files.
Steps to add Email attachments using Contents:
To send file attachments with the email, add a content with a name prefixed by the activity name followed by attachments. For example, if a file attachment has to be sent along with an email from an activity named 'EmailNotification', add a content with 'EmailNotificationattachments' as its name. The XPath expression should select the nodes which contain the path for the files to be attached. For example, //fileattachments.
Note:
- Supported file types for attachment include .au, .avi, .bas, .bmp, .cda, .cdr, .chf,
.dic, .doc, .docx, .dot, .drw, .dwg, .dxf, .eml, .eps, .gif, .gz, .htm, .html, .ico,
.img, .jpeg, .jpg, .ldb, .log, .mid, .midi, .mov, .movie, .mp1, .mp2, .mp3, .mpeg,
.mpg, .msg, .nws, .obd, .oft, .pcl, .pcx, .pdd, .pdf, .pic, .pot, .pps, .ppt, .pptx,
.pub, .qbb, .qbw, .qdb, .ra, .shtml, .snd, .text, .tga, .tif, .tsv, .ttf, .txt, .uu,
.vir, .wb2, .wbk, .wiz, .wk4, .wks, .wpd, .xlk, .xls, .xlsx, and.xlt.
- If the XPath Expression represents an Attachment control node in the Form XML Variable,
then the attachment would be added to the Email only if the Attachment value is as
per the Attachment control in the form with the properties Storage Type as Database and Security Mode as Encryption.
Activity Properties
The Email activity has to be configured by specifying appropriate values for the different properties in the Activity Properties area. The Activity Properties can be accessed by clicking on the Activity Properties tool in the Tool Bar or by selecting the appropriate option from the right click menu for the Email activity. The Activity Properties are organized under the following groups of related properties. The properties under each group are described in this topic.
Name & Description
The properties in the Name & Description group have been described below. You can use these properties to specify the name and description for the activity.
Name - This property can be used to specify a name for the activity.
Property Type: Optional (This property needs to be set only if necessary.)
Description - This property specifies a brief description to be displayed for the activity.
Property Type: Optional (This property needs to be set only if necessary.)
Configuration
The properties in the Configuration group have been described below. You can use these properties to specify the content of the notification.
To Resource - This property specifies the resource(s) to whom the email is to be sent.
Property Type: Mandatory (This property must be set if the action is to be assigned to any resource(s).)
Steps to set the To property
-
To specify the actors to receive the email, click the button for the 'To' property to open the property window.
-
In this window, build an expression to select the actors using the actors properties. Select an attribute from the first drop down list, then select the operator, type of value (Value, Variable, Content, XMLVariables), and the corresponding value for the property from the corresponding drop downs. Select "End" from the last drop down to complete the expression. If you are building a compound expression, you can select one of the logical operators to connect the different conditions that form the expression.
-
Add the condition to the expression by clicking Add. This will display the expression to the text area.
-
You can remove a condition already added to the expression by clicking Undo.
-
You can also clear an existing expression if necessary by clicking Clear. This is useful if you want to clear large expressions in the text area in order to build a new expression.
-
After building the expression, click Update to save it.
See Email: ToResource for a detailed description of the To property window.
See the Using XML Variables section in the About XML Variables topic for details on how to use the XMLVariables to build the expression.
To Email Address - This property is used to send an email to a user who is not a part of the resource provider. To send an email at an address that is a part of the resource provider the ToResource property is used.
Scenario
XYZ organization is one of the leading product development companies. Every new feature or product released needs to be notified to all customers. John Smith is one among the them.
The Email activity can be used for this. The To Email Address property should be set to John Smith's email address. Whenever the new feature or product is released, the workflow gets trigged to send an email to John Smith.
Features of the To Email Address Property:
The following are the features of the To Email Address property:
-
It is possible to send an email at any email address using the Expression Builder or directly entering the email address in the field.
-
It is possible to use the variables, XML variables and content, or any expression to set the email address to the property.
Configuration
To configure To Email Address, complete the following steps:
-
Right-click Email Activity to go to the Activity Properties.
-
Set the To Email Address property to send email to the resource who is not a part of the resource provider.
Note: If both ToResource and To Email Address values are set then the ToResource property is considered for sending the email.
BCC - This property specifies the resource(s) email id to which a copy of the email is to be sent as a Blind Carbon Copy. To specify the email recipient type the email id directly into the field.
Property Type: Optional (This property needs to be set only if required.)
BCCResource - This property specifies the resource(s) to whom a copy of the email is to be sent as a Blind Carbon Copy. To select the resource(s) click the button against 'BCCResource' in the Properties pane of the Process Designer. In the window that pops up, build the condition for selecting the resource(s) and click Update button.
Property Type: Optional (This property needs to be set only if required.)
Steps to set the BCCResource property
-
To specify the actors who will receive the email as BCC, click the button for the 'BCCResource' property to open the property window.
-
In this window, build an expression to select the actors using the actors properties. Select an attribute from the first drop down list, then select the operator, type of value (Value, Variable, Content, XMLVariables), and the corresponding value for the property from the corresponding drop downs. Select "End" from the last drop down to complete the expression. If you are building a compound expression, you can select one of the logical operators to connect the different conditions that form the expression.
-
Add the condition to the expression by clicking Add. This will display the expression to the text area.
-
You can remove a condition already added to the expression by clicking Undo.
-
You can also clear an existing expression if necessary by clicking Clear. This is useful if you want to clear large expressions in the text area in order to build a new expression.
-
After building the expression, click Update to save it.
See Email: BCC Resource for a detailed description of the BCCResource property window.
See the Using XML Variables section in the About XML Variables topic for details on how to use the XMLVariables to build the expression.
CC - This property specifies the resource(s) email id to which a copy of the email is to be sent as a Carbon Copy. To specify the email recipient type the email id directly into the field.
Property Type: Optional (This property needs to be set only if required.)
CCResource - This property specifies the resource(s) to whom a copy of the email is to be sent as a Carbon Copy. To select the resource(s) click the button against 'CCResource' in the Properties pane of the Process Designer. In the window that pops up, build the condition for selecting the resource(s) and click Update.
Property Type: Optional (This property needs to be set only if required.)
Steps to set the CCResource property
-
To specify the actors who will receive the email as CC, click the button for the 'CCResource' property to open the property window.
-
In this window, build an expression to select the actors using the actors properties. Select an attribute from the first drop down list, then select the operator, type of value (Value, Variable, Content, XMLVariables), and the corresponding value for the property from the corresponding drop downs. Select "End" from the last drop down to complete the expression. If you are building a compound expression, you can select one of the logical operators to connect the different conditions that form the expression.
-
Add the condition to the expression by clicking Add. This will display the expression to the text area.
-
You can remove a condition already added to the expression by clicking Undo.
-
You can also clear an existing expression if necessary by clicking Clear. This is useful if you want to clear large expressions in the text area in order to build a new expression.
-
After building the expression, click Update to save it.
See Email: CCResource for a detailed description of the CCResource property window.
See the Using XML Variables section in the About XML Variables topic for details on how to use the XMLVariables to build the expression.
Subject - This property specifies the subject of the email. The subject can be customized for each resource.
Property Type: Optional (This property need not be set. If it is not set, the default subject line from the Actions.xml file is displayed.)
Steps to set the Subject property
-
To specify the subject, click the button for the 'Subject' property to open the property window.
-
In this window, enter the subject text directly in the text editor.
-
If you want to customize the subject you can do so using the Field controls to add resource property values. For example, to add a subject that includes the email id of the actor submitting the approval request, you can do as follows: Type in the text "Expense Statement of ". Select "Variable" and "Variable.SubmittedBy.Email" from the two drop downs for Field and click Append. This will add the placeholder for the variable after the text entered in the text editor. At run-time this placeholder will be replaced by the corresponding value, i.e. the email id.
-
You can manipulate the text using the appropriate tools from the tool bar. You can cut, copy and paste text, undo and redo changes, zoom in and zoom out the view as well as print the text.
-
You can format the text, if necessary, using the formatting tools. You can make text bold or italic or change the font or size, set text color or background color.
-
After adding the subject, click Update to save it.
-
Click Close to close the window without saving the subject.
See Email: Subject for a detailed description of the Subject property window.
Body - This is the actual content of the email sent to the resource(s). The body can be customized for each resource.
Property Type: Mandatory (This property needs to be set.)
Steps to set the Body property
-
To specify the message body, click the button for the 'Body' property to open the property window.
-
In this window, enter the body text directly in the text editor.
-
If you want to personalize the body you can do so using the Field controls to add resource property values. For example, to add a body that includes the name of the actor submitting the approval request, you can do as follows: Type in the text "Hello". Select "Variable" and "Variable.SubmittedBy.name" from the two drop downs for Field and click Append. This will add the placeholder for the variable after the text entered in the text editor. At run-time this placeholder will be replaced by the corresponding value, i.e. the name, resulting in a personalized salutation. Type in a message in the next line to complete the message body.
-
You can manipulate the text using the appropriate tools from the tool bar. You can cut, copy and paste text, undo and redo changes, repeat the last command, zoom in and zoom out the view as well as print the text.
-
You can format the text, if necessary, using the formatting tools. You can make text bold or italic or change the font or size, set text color or background color.
-
After adding the body, click Update to save it.
-
Click Close to close the window without saving the body.
See Email: Body for a detailed description of the Body property window.
Note: You may not be able to send emails if Body content is not provided. The content must be a string with length of atleast one character.
Send only one copy to CC/BCC recipients - This property specifies whether to send multiple copies of the Email to CC/BCC recipients. The default setting is 'No'. This property is useful in case there are multiple recipients specified in the 'To' property and only one (or a number less than specified in the 'To' property) recipient in the CC or BCC property. If this properties is set to 'Yes', and there are 5 recipients specified in the 'To' property and one in the CC property, then the CC recipient will receive 5 copies of the same email.
Property Type: Optional (This property needs to be set only if necessary.)
Mail Format - This property specifies the format of the Email. If the value 'HTML' is selected, then the Email will be in the HTML format. If the value 'TEXT' is selected, then the Email will be in plain text format.
Property Type: Optional (This property needs to be set only if necessary.)
Attach Reports
This property is used to configure report to be sent as an email attachment.
Property Type: Optional (This property needs to be set only if necessary.)
The following image shows the Attach Reports property:
Steps to set the Attach Reports Property
-
To specify the Attach Report property, click the edit icon to open the property window. The Attachment Configuration dialog box appears.
-
In the Attach Report property, you can attach a report by selecting the Report Reference Variable through the Expression Editor. Alternatively, you can get the Report by clicking the Report icon and selecting the required report from the Reports list screen. To attach multiple reports, click Add to add new rows.
-
Click Submit.
See Email: Attach Reports for a detailed description of this property.
Activity outputs:
The Email Activity does not return any value.
Example for Email Activity
In the following workflow, if a Approver rejects the mail will send to Manager.

Approver 1: If approver1 Rejected a mail, it will send to Manager. If approver1 Approved a mail, it will go for the next Approver, that is Approver2.
Manager: In Email activity, specifies the resource(s) to whom the email is to be sent in To property.

Subject: In this property, specify the subject for the email. After adding the subject, click Update to save it.

Body: This is the actual content of the email sent to the resource(s). After adding the body, click Update to save it.

Exception Behavior
Each activity has the Raise Error on Unhandled Linked Output property on click of which, it shows all the default configured mapped error outputs in red with their check boxes selected.
See Mapped Error Outputs for more details.