send_personalized_email
Send a mail-merge email through the Email API: one call, many recipients, each with its own merge_vars object substituted into {{key}} placeholders in the subject, from name and body ({{{key}}} inserts raw HTML). Combined merge_vars must be at most 100 KB. Two steps: call first WITHOUT confirm to get a preview (recipient count, from, subject, merge keys) — nothing is sent. Show it to the user and get an explicit yes, then call again with confirm: true. dry_run: true previews without sending even when confirm is true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | CC addresses (use the first recipient's merge_vars) | |
| to | Yes | Recipients, each with its own merge_vars; each gets an individual message | |
| bcc | No | BCC addresses (use the first recipient's merge_vars) | |
| from | Yes | Verified sender email address | |
| html | No | HTML body. {{var}} is HTML-escaped, {{{var}}} is inserted raw | |
| text | No | Plain text body | |
| confirm | No | Must be true to actually send. Leave false first to get a preview | |
| dry_run | No | Validate and show the send preview without sending, even when confirm is true | |
| subject | Yes | Subject; {{var}} allowed | |
| version | No | 1.0 for HTML or 2.0 for AMP (default: 2.0 when amp_html is given, else 1.0) | |
| amp_html | No | AMP HTML body (needs version 2.0) | |
| reply_to | No | Reply-to addresses (verified senders; no {{var}}) | |
| from_name | No | Sender display name; {{var}} allowed | |
| attachments | No | Attachments (array of name and url) |