sendEmail

Flow pipeline processor that facilitates sending emails.

The email details are parsed from the message exchange payload, which has a strictly defined schema.

Currently, only simple email sending is supported, meaning that the email content is expected to be static and defined in the message payload, and there is no support for attachments. The email content can either be a plain text or an HTML, but the processor does not do any content type validation, so it is the caller’s responsibility to ensure that the content is in the expected format.

The following table describes the element structure of the message payload:

field name          | type         | required                           | description
--------------------|--------------|------------------------------------|--------------------------------------------------------------
from                | String       | no                                 | Sender address
to                  | List<String> | yes (non-empty)                    | List of email recipients
cc                  | List<String> | no                                 | List of CC recipients
bcc                 | List<String> | no                                 | List of BCC recipients
replyTo             | String       | no                                 | An address that will be set in the Reply-To header
subject             | String       | no                                 | Email subject
plainTextBody       | String       | yes (or htmlBody - non blank)      | Email message body in plain text format. Mutually exclusive with `htmlBody`
htmlBody            | String       | yes (or plainTextBody - non blank) | Email message body in HTML format. Mutually exclusive with `plainTextBody`

Examples payloads:

{
  "from": "sender@example.com",
  "to": ["recipient@example.com"],
  "cc": ["recipient_cc@example.com"],
  "bcc": ["recipient_bcc1@example.com", "recipient_bcc2@example.com"],
  "replyTo": "replyto@example.com",
  "subject": "Hello",
  "htmlBody": "<h1>HTML content</h1>"
}
--------
{
  "from": "sender@example.com",
  "to": ["recipient@example.com"],
  "cc": ["recipient_cc@example.com"],
  "bcc": ["recipient_bcc1@example.com", "recipient_bcc2@example.com"],
  "replyTo": "replyto@example.com",
  "subject": "Hello",
  "plainTextBody": "Plain text content"
}

!NOTE The processor requires the flow server to be configured with SMTP server details.

Properties

Name Summary

connectionTimeoutMillis

The time to wait while connecting to a remote server.

receiveTimeoutMillis

Optional amount of milliseconds that control the maximum amount of time the client will wait for the response of a request.

retainPayloadOnFailure

Whether the incoming payload is available for error processing on failure. Defaults to false.

name

Optional, descriptive name for the processor.

id

Required identifier of the processor, unique across all processors within the flow. Must be between 3 and 30 characters long; contain only lower and uppercase alphabetical characters (a-z and A-Z), numbers, dashes ("-"), and underscores ("_"); and start with an alphabetical character. In other words, it adheres to the regex pattern [a-zA-Z][a-zA-Z0-9_-]{2,29}.

exchangeProperties

Optional set of custom properties in a simple jdk-format, that are added to the message exchange properties before processing the incoming payload. Any existing properties with the same name will be replaced by properties defined here.

Sub-builders

Name Summary

externalSystemDetails

Information describing external system integration. Optional.

inboundTransformationStrategy

Strategy that customizes the conversion of an incoming payload by a processor (e.g., string to object). Should be used when the processor’s default conversion logic cannot be used.

messageLoggingStrategy

Strategy for describing how a processor’s message is logged on the server.

payloadArchivingStrategy

Strategy for archiving payloads.