Skip to main content
Templates store a subject and body with variables. Names are immutable and unique within the account. body_type is text or html.

Create a template

Open Email, then Templates, and click Create template. Enter the subject and body templates and choose the body type. Open the saved template to edit it or send a test message.

Variables and escaping

Use {{name}} or {{ name }} for a simple variable. template_data is an object whose values are strings. The response’s variables field lists detected variables. Missing values render as empty strings, so validate required values in your application before sending. HTML bodies escape inserted variable values; subjects and text bodies are plain text. Send POST /v1/sent-messages with template content:
The identity and template accept UUIDs, names, or CRNs. Sending requires email:SendMessage on the identity and email:SendTemplatedMessage on the template. configuration_set can apply tracking, pool selection, and suppression overrides. The template is rendered before queueing; later template edits do not change accepted messages.

Batch sends

POST /v1/sent-messages/batch accepts a messages array with up to 50 ordinary send requests. Each entry can use text/HTML, raw MIME, or template content. Supply personalized template_data in each entry. Identity and template permissions are checked for every entry before any message is queued. Sending restrictions, rendering, suppression, storage, and quota failures then produce individual results. Results preserve input order; index identifies the input and status is queued or rejected. Queued results include a message ResourceRef. Rejected results include the standard error object with code, message, and request_id. Queued does not mean delivered. Check every result even when the HTTP request succeeds. Preserve the original Idempotency-Key for transport retries of the same batch. Retry only rejected entries as a new request after correcting their errors; a new key for the entire batch can duplicate messages already accepted.