Skip to main content

Sending email (v1)

Preview / Alpha

This step is in preview / alpha. It is not yet available in the flow editor and does not send any email yet. Its functionality and documentation can still change.

Sends an informational email to the user's email address​

Sending email (v1) sends an informational email to the email address of an ExtendedIdentity data block, supplied at session creation or produced by an earlier step in the flow. It is the email counterpart of Sending SMS (v1) (SEND_SMS:v1) and is intended for journeys that begin on one channel and need the user to continue from their inbox.


Key features​

  • Background step: no Player screen is rendered and the user is not interrupted.
  • Recipient from the identity: the step emails the emailAddress of an ExtendedIdentity data block. When that block carries no email address, the step takes the unreachable route instead of failing the session.
  • Customer-supplied content: an optional subject and an HTML body, a plain-text body or both are separate MessageTemplate data blocks supplied at session creation, so the customer controls the wording, the markup and the language. At least one body is required; the subject is optional. Declare one messageTemplate input per template on the Start step and wire each to the step with inputMapping.
  • Reserved placeholder: the only supported placeholder is {session.url}, which the step replaces with the full Player link. The placeholder may appear anywhere in a template, any number of times; using no placeholder is also valid. Unlike Sending SMS (v1) (SEND_SMS:v1), the link is not shortened.
  • Template rules: the HTML and plain-text bodies may contain links and markup but no control characters other than tabs and line breaks, and no invisible or bidirectional formatting characters. These rules are checked at session creation, on every messageTemplate input of the flow.
  • Content is not sanitised: the bodies are your content, sent to your own end users, so styles, links and markup are delivered as written. The platform checks them for control and hidden characters only. If you build a preview of an email, sanitise the HTML before you render it.
  • Subject rules: the subject is optional. When none is supplied, the email is sent with a single space as its subject, because the messaging service rejects an empty one. A subject you supply must be a single line of at most 998 UTF-16 code units. The step checks this when it sends the email, not when the session is created, so a subject with a line break is not rejected at session creation.
  • One set of templates per step: a flow may contain several Sending email steps. Give each its own messageTemplate inputs, so the content of each email is supplied separately at session creation. The flow editor names them emailSubject, emailText and emailHtml for the first step, then emailSubject2, emailText2 and emailHtml2 for the second, and so on. Steps that point at the same inputs send the same content.
  • Fixed sender: the sender address is set by the messaging service and cannot be changed. Use the replyTo option to receive replies at your own address.
  • Fire and forget: the step does not wait for delivery or track it. A sent route means the mail relay accepted the email, not that it reached the recipient's mailbox. If the messaging service is rate limiting or briefly unavailable, the step retries the send before it fails; an email the relay has already accepted is not sent again by design, but a timeout after acceptance can still produce a duplicate.
  • Two routes: sent when the messaging service accepts the email, unreachable when the identity carries no email address or the service reports that the recipient cannot receive email.

Configuration​

OptionTypeRequiredDescription
replyTostring<email>NoAddress that receives the recipient’s replies. Optional. The sender address is fixed by the messaging service and cannot be changed.

Input data blocks​

Input slotData blockRequiredDescription
extendedIdentityExtendedIdentityYesIdentity whose emailAddress is messaged. A missing address routes the step to unreachable.
htmlTemplateMessageTemplateNoThe HTML body of the email. Optional, but at least one of htmlTemplate and textTemplate must be mapped. Declare a messageTemplate input on the Start step and wire it here with inputMapping.
textTemplateMessageTemplateNoThe plain-text body of the email, shown by mail clients that do not display HTML. Optional, but at least one of htmlTemplate and textTemplate must be mapped. Declare a separate messageTemplate input on the Start step and wire it here with inputMapping.
subjectTemplateMessageTemplateNoThe subject line of the email, as plain text. Optional: when no subject is supplied the email is sent with a single space as its subject, because the messaging service requires one. It must be a single line of at most 998 UTF-16 code units; the step checks this when it sends the email, not at session creation. Declare a separate messageTemplate input on the Start step and wire it here with inputMapping.

Routes​

RouteDescription
sentThe messaging service accepted the email. This confirms hand-over to the mail relay, not delivery to the recipient’s mailbox.
unreachableNo email address was available in the extended identity, or the messaging service reported that the email cannot be delivered.

Output data blocks​

RouteData blocks produced
sent—
unreachable—

Example payloads​

At session creation, supply the identity and one template per declared input:

{
"input": {
"extendedIdentity": {
"emailAddress": "jane.doe@example.com"
},
"emailHtml": {
"template": "<p>Hello,</p><p><a href=\"{session.url}\">Continue your verification</a></p>"
},
"emailSubject": {
"template": "Continue your verification"
},
"emailText": {
"template": "Continue your verification here: {session.url}"
}
},
"metadata": {
"subjectId": "customer-subject-id"
}
}