Skip to main content
sendEmail delivers a templated transactional email to a recipient through the platform’s transactional email gateway. You reference a template by ID and pass variables to hydrate it; the platform proxies the send so you never touch gateway credentials or sending infrastructure. By the end of this page you can wire a Form block to send a confirmation email on submit, or fire a notification from any block with a capability hook.

Invoke from a Form block

The canonical pattern: a Form block firing sendEmail on submit. Form-field bindings (the runtime’s template-expression syntax) resolve against the submitted data before dispatch.
lead-form.json
{
  "block": "Form",
  "props": {
    "schema_table": "leads",
    "fields": ["name", "email"],
    "on_submit": {
      "capability": "sendEmail",
      "args": {
        "template": "lead-thankyou",
        "to": "ada@acme.com",
        "variables": {
          "first_name": "Ada"
        }
      }
    }
  }
}
The runtime validates the args, renders lead-thankyou with the variables, hands the message to the email gateway, and returns a message_id you can use to track delivery.

Inputs

Outputs

Provisioning

The workspace must have a verified sending domain before sendEmail can dispatch. Verification is handled in the Builder’s email settings — add a domain, publish the DNS records the Builder shows you, and wait for the gateway to confirm. Until verification completes, calls return domain_not_verified. Email templates are defined in the Builder’s template editor. Create and preview a template before referencing it by ID — invalid IDs return template_not_found.

Error codes

Every error returns the standard envelope:

Idempotency

sendEmail is not idempotent by default. A retry sends a second email. If you wire on_submit to sendEmail, debounce the submit button or use a server-side dedupe key in variables to prevent duplicate sends from double-clicks.

storeFile

Upload a file and return a signed or public URL.

Send email guide

Verify a domain, author a template, and wire it to a form.