Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

send_email

Sends transactional email through an SMTP connector. Transport, credentials, TLS mode, and the default sender live on the connector; the message lives here.

Synopsis

{
  "name": "send_email",
  "input": {
    "connector": "mailer",
    "to": {
      "var": "data.email"
    },
    "cc": "…",
    "bcc": "…",
    "subject": {
      "cat": [
        "Order ",
        {
          "var": "data.order_id"
        },
        " confirmed"
      ]
    },
    "text": {
      "cat": [
        "Your OTP is ",
        {
          "var": "temp_data.otp"
        }
      ]
    },
    "html": "…",
    "from": "…",
    "reply_to": "…",
    "headers": {},
    "output": "temp_data.mail_result"
  }
}

Description

send_email is a connector function. It names a connector for its credentials and endpoint. Orion validates its input when the workflow is saved, and the call runs through the connector’s circuit breaker.

Retry safety: unsafe_write. See Retry safety for what the answer costs.

No automatic retries. A timeout after the message body is transmitted is indistinguishable from an accepted message. SMTP has no idempotency key, so a retry would be a duplicate email. The circuit breaker still applies.

Fields

FieldTypeRequiredDefaultDescription
connectorstringyesName of the SMTP connector
tostring | arrayyesRecipients; each is addr@example.com or Name <addr@example.com>
cc / bccstring | arraynoSame address forms
subjectstringyesUTF-8 subject
textstringone of text/htmlPlain-text body
htmlstringone of text/htmlHTML body; with text too, the message is multipart/alternative
fromstringnoconnector fromHonored only when the connector sets allow_from_override
reply_tostringnoThe Reply-To address
headersobjectnoExtra headers (string values). Structured names (From, To, Subject, Content-Type, …) are rejected — this is for List-Unsubscribe, Auto-Submitted, correlation IDs
outputstring | JSONLogicno"data"Where { "message_id", "response" } is stored — the generated Message-ID (for correlation/threading) and the server’s acceptance line

A wrong address fails at workflow create when static (naming the field and index) and at send time when resolved from the message. Rejected recipients fail the task with the server’s reply — no partial-success reporting.

Every field above except connector, headers and output is JSONLogic. A body or a subject can therefore be composed in the task rather than in a map task ahead of it:

Examples

{
  "name": "send_email",
  "input": {
    "connector": "mailer",
    "to": { "var": "data.email" },
    "subject": { "cat": ["Order ", { "var": "data.order_id" }, " confirmed"] },
    "text": { "cat": ["Your OTP is ", { "var": "temp_data.otp" }] },
    "output": "temp_data.mail_result"
  }
}

Last verified 14 September 2026