Send transactional or marketing email
Queues an email for sending. The default emailType is transactional. Set it to marketing for a consented single-recipient lifecycle or promotional message. Marketing mode creates or links a minimal subscriber, honors unsubscribe suppression, adds the standard marketing footer, and emits RFC 8058 one-click-unsubscribe headers. The caller remains responsible for having consent or another lawful basis.
You can either:
- Provide a canonical slug (or compatibility alias templateId) to use a saved template
- Provide subject and canonical body (or compatibility alias html) to send custom content directly
If both a canonical field and its alias are provided, slug must match templateId and body must match html.
Recipients:
- to can be a single email or an array of up to 50 emails
- Duplicate emails are automatically deduplicated
- Marketing mode requires exactly one to recipient and does not support cc or bcc
Attachments:
- Attachments can be provided as Base64-encoded content or URLs
- Maximum total attachment size: 40MB per email
- Any file type supported (PDFs, images, documents, etc.)
A successful response means the email was accepted for background processing. Transactional emails are not blocked by subscriber unsubscribe or double opt-in status. If a recipient is suppressed because of a hard bounce or spam complaint, the worker records the send as suppressed instead of delivering it.
Optionally set from (domain must be verified) and replyTo addresses. When reply tracking is enabled, Sequenzy uses a unique trackable Reply-To header and treats the resolved reply destination as the forwarding destination for captured replies. When replyTo is omitted, direct-content sends inherit the company's default reply profile and saved-template sends prefer the template reply profile before the company default. Both fall back to the first company reply profile. The resolved destination is retained whether or not reply tracking is enabled; it is sent as the Reply-To header only when reply tracking is disabled. Variables can be passed to customize the email content. Nested objects and arrays are supported for repeat blocks, such as items. {{viewInBrowserUrl}} is generated automatically for a hosted copy link. For a single recipient, Sequenzy matches an existing subscriber by subscriberExternalId or email and backfills stored first and last names when the corresponding request variables are omitted; explicit variables take precedence. Returns immediately with a durable emailSendId and the accepted emailType. If Sequenzy detects likely missing or unused variables before queueing, the successful response includes a non-blocking diagnostics warning object. Missing values do not block queueing or sending; a required variable that is not provided and has no default renders as an empty string.
Request body
Example request
{
"slug": "welcome-email",
"templateId": "welcome-email",
"subscriberExternalId": "user_123",
"emailType": "marketing",
"subject": "Welcome to our platform!",
"body": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
"html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
"preview": "Welcome to our platform",
"variables": {
"NAME": "John",
"event": {
"items": [
{
"title": "Pro plan",
"description": "Monthly subscription"
}
]
}
},
"from": "Notifications <notifications@example.com>",
"replyTo": "Support <support@example.com>",
"attachments": [
{
"filename": "invoice.pdf",
"path": "https://example.com/invoices/123.pdf"
}
],
"trackingSettings": {
"clickTracking": false
}
}Response
Email queued successfully
Example response
{
"success": true,
"emailSendId": "send_abc123",
"jobId": "job_abc123",
"diagnostics": {
"status": "warning",
"message": "Email was queued. A required variable is missing and will render as an empty string.",
"missingRequiredVariables": [
{
"name": "RESET_URL",
"lookupName": "reset_url",
"message": "Email was queued. Required variable \"RESET_URL\" is missing and will render as an empty string.",
"usedIn": [
{
"surface": "block",
"field": "url",
"blockId": "reset-button",
"blockType": "button"
}
],
"suggestions": [
"resetpasswordlink"
]
}
],
"unusedVariables": [
{
"name": "resetpasswordlink",
"message": "Variable \"resetpasswordlink\" was provided but is not used by the email template.",
"suggestions": [
"reset_url"
]
}
]
}
}