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 samples.
  • A JSON Record Data List (see the REST API Cookbook and JSON Record Data List example). When the 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.

Content creation may be aborted by a script in a Connect template that raises a fatal error. This triggers the On Error tab of the Content Creation task. See Designer Script API.

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.
Email Info tab
  • Sender Address: Enter the email address that appears in the "From" field of the email.
  • 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 (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 User Options page of the 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 General appearance preferences), 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.