Email messages can be automatically sent upon the success or failure of an operation. Email messages can also be configured to used by an email target in an operation, or used as an argument to the
Create an Email Message¶
Follow these steps to create and configure an email message to be sent on success or failure of an operation:
In the project tree, right-click the Email Messages node and from the menu select New Email Message.
The New Email Message tab appears in the right pane:
Complete the properties of the message.
The fields SMTP Mail Servers, To, From, Subject, and Text recognize global variable substitutions. For example, if you don't know who the recipient will be until runtime, you can set a global variable called
notify_emailin the transformation (using a
DBLookupor with input data) and then enter
[notify_email]in the To field.
Name: (Required) The name of the message, which must be unique within the project.
SMTP Mail Servers: Comma-separated list of SMTP servers to use to send the email. The servers will be tried in the order that they are specified until one is found that accepts the message.
To provide support for OAuth 2.0 with Microsoft 365 email, additional parameters can be passed in the SMTP host string using the SMTP Mail Servers field. For instructions, see OAuth 2 Support for Microsoft 365 Email below.
To: (Required) Comma-separated list of recipients.
From: The email address to appear in the From field when the recipient(s) read the email.
Use SSL/TLS: Select to encrypt the email using SSL/TLS protocol.
Authentication: To use basic authentication, expand Authentication and select Use authentication. You can then enter an Account and account Password.
OAuth 2.0 is supported for Microsoft 365 as described in OAuth 2 Support for Microsoft 365 Email below.
Optional: Expand Optional to show additional optional fields:
- CC: Comma-separated list of email addresses to receive a copy of the message.
- BCC: Comma-separated list of email addresses to receive a blind copy of the message.
- Reply To: An email address you want replies to be sent to (used by default when the recipient replies in their email application). This can be used if you send the email from a one account but you want replies to go to a different email account.
Subject: The subject of the email.
Text: The body of the email.
Click the Save icon in the toolbar in the upper right to save the email message.
In the project tree, click the operation to which you want to add the notification message.
The operation graph appears in the right-hand pane.
In the operation graph, click the at the top of the operation graphic to show the operation menu.
From the menu, select On Success > Email > Select Existing or On Failure > Email > Select Existing.
A pop-up window displays the list of existing email messages. Select the email message created in the previous steps and click OK.
The email message will be added to the operation graphic:
- A green line and icon are shown for an email message configured to send on success of the operation.
- A red line and icon are shown for an email message configured to send on failure of the operation.
OAuth 2.0 Support for Microsoft 365 Email¶
To use OAuth 2.0 with Microsoft 365 email, you provide additional parameters in the SMTP host string using the SMTP Mail Servers field. These additional parameters are supported with Cloud Agents 11.3 or later, 11.x Private Agents that are at least version 11.1.1, and 10.x Private Agents that are at least version 10.63.1.
The properties in the SMTP Mail Servers field should be in the following format:
<SMTP Host>?clientId=<Client ID>&tenant=<Tenant>&clientSecret=<Client Secret>
|SMTP Host||The SMTP server.|
|Client ID ( ||The client ID obtained from the OAuth provider.|
|Tenant ( ||The tenant ID obtained from the OAuth provider.|
|Client Secret ( ||The tenant ID obtained from the OAuth provider.|
These additional optional parameters may also be used if required to override default values:
|Port ( ||The SMTP port.|
|URL Encoding ( ||Default: |
|Scope ( ||Default: |
|Token ( ||Default: |
|Grant Type ( ||Default: |
Example inputs for the SMTP Mail Servers field using OAuth 2.0:
Filename keywords such as
[date] do not work in the Subject or Text fields.
As an alternative, you can use the Jitterbit function
date. To pass a date as a variable, you can create a variable in a script and assign it a value, and then use it in the email message. For example:
$date = Now(); # Gives the current date and time $date = CVTDate(Now(),"yyyy-mm-dd HH:MM:SS","yyyy-mm-dd"); # Gives just the date
You can use HTML in the body of the message:
Variables (in this case, a global variable
email.html) can be used inside HTML tags: