Create Email Content
The Create Email Content task generates a set of email content items from a template's Email Context, which are then sent directly to the recipient set in each record.
Input
This task must receive either Metadata containing information regarding a valid Record Set, or JSON data.
Metadata
The Execute Data Mapping task and the Retrieve Items task output metadata containing information regarding a Record Set.
JSON
The Create Email Content task supports two types of JSON:
- A JSON object or an array of JSON objects representing records. If a value in a record object is a string, it is considered to be a field value. If a value in a record object is a JSON object, it is considered to be a nested table with detail records. For examples, see JSON string examples.
- A JSON Record Data List (see the REST API Cookbook and JSON Record Data List example). When the Execute Data Mapping or Retrieve Items task is set to output Records in JSON, it outputs this kind of JSON data.
If the input is JSON, the task performs a REST call to the /rest/serverengine/workflow/contentcreation/email/{templateId} endpoint on the Connect Server. For more information see the REST API Cookbook.
Processing
This task loops through each record in a Record Set or through each JSON object in an array. For each record or JSON object, an HTML Email is generated using that record's or object's data. The output generated is then sent via an SMTP server with the email address set by the template.
The number of log messages for any non-fatal errors is limited to 100. Non-fatal errors are errors related to one record that will not stop the processing of all records. For example, when the recipient’s email address in a record is invalid, that record produces a non-fatal error; subsequent records will still be processed.
Output
Within the Workflow process, the output to this task is only modified metadata indicating that the task is complete. It is the Server component that outputs the emails themselves and sends them to each recipient.
If sending email is not included in the license, the emails will be sent to the sender instead of to the intended recipients.
Properties
General Tab
-
Template
-
"%o": Select to use a dynamic template name. Click on %o to change the expression that determines the name of the template to use.
-
Template Names: Select the appropriate template. Adding template is done through the Send to Workflow option in the Designer Module.
-
-
Section: Enter the section name that will generate output. Only one section can be output. If no section is defined or if the section name is invalid, the default section will be output.
-
Data Source (see Input):
-
Metadata:
-
Update Records from Metadata: If the process metadata has been modified by any of the Metadata tasks, check this option to update the records in the Connect database with the metadata and use the updated records. Otherwise, only the ID of the current job is sent, and the unchanged records are used.
-
-
JSON:
-
JSON String: a JSON object or an array of JSON objects representing records (see JSON string examples) or a JSON Record Data List (see the REST API Cookbook and JSON Record Data List example).
This option requires that keys in the JSON data have matching field names in the data model of the template. When they have, the JSON values are passed to the template and the personalization scripts of the template will have access to the values through the record's data fields. (See the Designer help: Adding Variable Data.)The JSON format is not validated by the plugin; it is passed as is to the server.
-
-
-
Runtime Parameters: The runtime parameters defined in the selected template are displayed and their values can be set here. (See Runtime parameters in the Online Help of OL Connect.)
Right-click the field to open the contextual menu that allows to select variables, data and lookup functions (see Data selections).
If the template name is dynamic, you must enter the name (or select a variable that contains the name) and set the value of all runtime parameters that may occur in the template.
If a runtime parameter is defined in a template, but not set in the task properties, an error will be raised. Note that it is not possible to change a parameter's type here; that can only be set in the template itself.
At runtime, Workflow passes the parameter values as strings, and the type defined in the template will be used to try and parse the input parameter value. In order to make this work: Boolean values need to be entered as either “true” or “false”. (When the comparison actually occurs, it will be a full Boolean comparison. Thus it can compare this runtime parameter with Boolean data values that are stored as 0/1 in data fields.) Numeric string values need to be parseable as a number (either a whole integer or decimal value). Dates should be in an ISO8601 compatible format (e.g. 2019-10-15) or use the current Windows Locale date settings options. The latter is not recommended as it requires all computers in the cluster have the same locale data format.
Email Info tab
- Sender Address: Enter the email address that appears in the "From" field of the email. Alternatively you may enter the sender's name and email address in the following format:
John Smith <johnsemail@hisserver.com>
. It depends on the email client which information gets displayed: the sender's name or email address, or both. -
Mail host: Enter the address of the SMTP server through which emails should be routed. The address can include a port number. This information should be available from your IT staff.
-
Send emails to sender (test mode): Check to ignore the email address from each record and send all emails to the address entered in the Sender Address field instead.
-
Precedence to template address: If the sender's address is given in the template, that address gets precedence over the one specified here.
-
Use encryption (TLS): Check to connect to the SMTP server using TLS 1.0 (Transport Layer Security, also called "SSL").
-
Use Authentication group: Check to enable authentication to the SMTP server.
-
User name: Enter a user name that has permission to send email through the SMTP server.
-
Password: Enter the password for the above user name.
-
-
Attachments:
-
Print Context as PDF document: Check to generate the Print context in the template as a PDF and send it with the email as an attachment.
-
Web Content as HTML page: Check to generate the active Web section in the template as an HTML page and send it with the email as an attachment
-
-
Test SMTP settings: Validates the format of the sender's address and mail host and tries to send a test email. This won't work when the option Start TLS is checked.
OL Connect Proxy Tab
This tab is common to all OL Connect tasks and defines where to process the jobs sent through these tasks. When these fields are empty, they use the defaults set in the OL Connect preferences.
Defaults are not used unless the configuration is sent to the Workflow service.
-
OL Connect Proxy Address: Enter the machine name or IP Address where the OL Connect Server resides.
-
Port: Enter the port to use to communicate with the OL Connect Server. Default: 9340
-
User name: Enter the user name expected by the OL Connect Server.
-
Password: Enter the password expected by the OL Connect Server for the above user name.
On Error Tab
For a description of the options on the On Error tab see Using the On Error tab.
Miscellaneous Tab
The Miscellaneous tab is common to all tasks.
It contains a text area (Task comments) that lets you write comments about the task. These comments are saved when the dialog is closed with the OK button and are displayed in The Task Comments Pane.
Check the option Use as step description to display the text next to the icon of the plugin in the Process area.
The tab also provides an option to highlight the task in The Process area with the default color, set in the Preferences (see Colors), or the color selected or defined under Highlight color on this tab.
To revert the selected highlight color to the default color, open this tab, turn the Highlight option off and close the dialog with the OK button; then turn highlighting back on.
Highlighting can also be turned on and off via the task's contextual menu and with the Highlight button on the View ribbon.