Content Extended Operations example 5: Send mail with a template

The sendMailTemplateAttachment parameter allows you to use a template with an attachment. The content is added to the e-mail as a MIME attachment.

The purpose of a sendMail template is to allow for intricate and formatted e-mails using HTML. A template is an HTML file, which contains one or more replacement tokens to embed workflow-specific data into the body of the e-mail. This information might include an account number, customer name, or phone number.

Each token is marked by using the $ symbol, and followed by the number of the token. For example, $1 is the first token, $2 is the second token, and so on. An array of string values (the templateVals parameter) is passed from the workflow and its contents are used to replace the tokens in the template.

Email template

To attach the template to a workflow

  1. Click the Component step to get to the Properties pane.
  2. In the General tab, click New in the Operations area.
  3. Select sendMailTemplateAttachment.
  4. Specify the following expression values in the Operation Parameters section:
  5. Click OK.

To verify that the template is attached to a workflow

  1. Click Action > Workflow Properties.
  2. Click the Attachments tab.
  3. Verify that the e-mail attachment and e-mail templates are attached.
  4. Click Close.