Sending Emails

One of the most common needs, when we are automating business processes, is sending notification by email. In this article, we show you how to send emails using the Message intermediate event with the HEFLO mail connector.

Before adding the element make sure that the process has the automation enabled. Click on the gear icon on the top side of the process editor.

  1. Add the “Message” intermediate event, located in the BPMN toolbox on the left.
  2. Select the element, access the properties tab on the right side, and change the “Behavior” attribute to the “Throw” option. See that now the envelope is full.
  3. Select the “Mail” option in the “Connector” property.
  4. Set up a “Message template” for the event.
    1. Click the + icon of the “Message Template” property.
    2. Give a “Name” to the template, and enter a “Subject”. Also, you can use information from fields of the work item. So, just type a colon “:” or click on “Click here to add dynamic content” (see the image below), and search for the desired field.
    3. Complete the “Body template” of the message. Here you can also use dynamic content. In this case, just type : and search for a field.
    4. You can include attachments using the following ways:
      • Insert a link in the body of the email: click on the chain icon in the editor toolbar.
      • Insert a link to a field of type “File” from the work item (a file attached in a previous form). Click the “Attachments” button to enable the following fields.
      • Any constant field: just drop a file on the upload area. See the image below:Finally, click “Confirm” to save your new message template.
    5. Add recipients to the message by filling in the “Recipients Type” property, from the options you can choose:
      • “Role”: define the role that contains the desired recipients. Select one the existing roles or create a new one with a click on the + icon of the property.
      • “Work item field”:  define the field in the work item that contains the desired recipient email. This option is commonly used to select a field previously entered in the same process.
    6. In the “Carbon copy” field you can include one or more emails separated by semicolons.

 

Finally, complete your process and test it. During the tests, all messages will contain the prefix “Test” in the subject.

See also: How to perform process automation tests.

Was this article helpful?

Related Articles