Email task definition object

Email task (identified by "type": "Email") is used to send emails on your behalf when something happens in the workflow.

Here is an example of a Email task:

"Send Email": {
  "credentials": "CredentialsId",
  "description": "Example email",
  "type": "Email",
  "email": {
    "fromName": "Ben Smith",
    "subject": "My great email",
    "html": "<p>This is a sample</p>",
    "text": "This is a sample",
    "toAddresses": ["me@example.com"],
    "ccAddresses": [],
    "bccAddresses": [],
    "replyToAddresses": [],
    "attachments": [],
  },
  "end": true
}

The execution of this example task above will provide the following output:

{
  "email": {
    "fromName": "Ben Smith",
    "subject": "My great email",
    "html": "<p>This is a sample</p>",
    "text": "This is a sample",
    "toAddresses": ["me@example.com"],
    "ccAddresses": [],
    "bccAddresses": [],
    "replyToAddresses": [],
    "attachments": [],
  },
}

The JQ task has the following additional fields:

Field

Type

Required

Description

email

JSON Object

Yes

A configuration for email represented by a JSON Object.

Email field top-level fields

Field

Type

Required

Description

fromName

String

No

The display name. This will be what the recipients will see in the email.

subject

String

Yes

The email subject.

html

String

Yes

The email body.

Either or both of html and text must be defined.

text

toAddresses

JSON Array

Yes

The String array of 'To' email addresses.

ccAddresses

JSON Array

No

The String array of 'CC' email addresses.

bccAddresses

JSON Array

No

The String array of 'BCC' email addresses.

replyToAddresses

JSON Array

No

The String array of replay-to email addresses.

attachments

JSON Array

No

The String array of workflow task attachment IDs to add to email as attachments.

The Email object values can reference task input with JSONPath expression, the expression must be inside a placeholder ${ }.

To escape the expression, prefix it with an extra $ character, e.g. $${ }. See JSONPath for more information about JSONPath.

JSONata expression can also be used instead of JSONPath, prefix the expression with jsonata, e.g. ${jsonata: }. See JSONata for more information about JSONata.

The result for the Email task is a JSON Object with the following fields:

Field

Type

Description

email

JSON Object

The email that sent to the recipients.