Email Sending Task

Overview

Email Sending Task allows you to send emails while process execution. For successful sending, the Email add-on should be installed.

This is a custom task developed by Jmix, not BPMN standard task.

Graphical Notation

A service task is visualized as a rounded rectangle with a small envelope icon in the top-left corner. The icon is filled to represent task sending semantics.

email task

Properties

An email task has the following properties:

email task properties

To configure email task:

  • First, you have to set general task properties.

  • Then, set specific email parameters.

  • Create Execution listeners if necessary.

  • About the Async flag, see details in the Transactions section.

Email sending task doesn’t have multi-instance properties available. But you can use it within an embedded subprocess that is multi-instanced. See the Multi-Instance section.

Email Parameters

The email task has common parameters while sending emails — addressee, sender, subject, etc.

Set Addresses

There are few fields with addresses: To, Cc, Bcc, and From.

The first three can contain a list of emails, so use Email Address Editor to fill them by clicking edit button Edit button.

You can use a process variable or expression to provide the address, or specify it directly. Several addresses are possible and can be set in the editor:

address editor

From is a sender’s address, so it can be only one. Because of that, the address editor isn’t used. You can place here a direct value or expression as well.

  • Subject - an email subject. You can use a process variable in the subject.

  • Content - a body of the email. In the editor, you can select the type of content: HTML or plain text. Using process variables is available.

    email content editor
  • Content type - defines a type of content, plain text or HTML.

    content type

Asynchronous Sending

  • Send asynchronously - by default, emails are sent asynchronously.

    send async

    Don’t miss this parameter with the Async flag common for all tasks.

Attachments & Content

  • Attachments - a file content. It should be specified as an expression: a process variable or a Spring bean method call. The File, FileRef, byte[], and FileDescription types are supported.

    Providing an attachment name is optional. If the name is not specified, it will be taken from the file content. In case of byte[] as a file content, the default attachment_<incremental_part> naming will be used.

    create attachment