mailkite_send_batch
Send up to 50 personalized emails in one API call, merging per-recipient data into each message. Returns per-recipient results so a batch can partially succeed.
Instructions
Send one personalized message per recipient (up to 50) in a single call. Shared fields form the base message; each recipients[] entry gets its own message to exactly one address, with per-recipient templateData and headers merged over the shared ones. Every message passes the same gates as send() and gets its own id; the response reports each recipient's outcome in order, so a batch can partially succeed. Pass scheduledAt to park the whole batch for later (one cancelable ssnd_… per recipient). Requires an API key (mk_live_…).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | An address on a verified domain. Shared by every message in the batch. | |
| html | No | May contain {{merge_tags}}, filled per recipient. | |
| text | No | May contain {{merge_tags}}, filled per recipient. | |
| headers | No | Shared extra raw MIME headers for every message, applied after threading headers (caller wins); a recipient's own headers override these key-by-key. | |
| replyTo | No | ||
| subject | No | Required unless supplied by a template. May contain {{merge_tags}}, filled per recipient. | |
| inReplyTo | No | Thread every message under this Message-ID. | |
| recipients | Yes | One entry per message. Order is preserved in the response's results[]. | |
| templateId | No | Send using a saved template — a user template (tpl_…) or a base template (base_…). Its subject/html/text seed every message; explicit subject/html/text here override them. | |
| trackOpens | No | Open-tracking override for every message in the batch (HTML only). Omitted → the from-domain's default applies. | |
| attachments | No | Attached to every message in the batch. Same shape as send()'s attachments. | |
| scheduledAt | No | Send later: ISO 8601, simple relative natural language ("in 2 hours"), or a ms-epoch. A future time parks every message with the scheduler (each gets its own ssnd_… id, individually cancelable); omitted or past sends now. | |
| trackClicks | No | Click-tracking override for every message in the batch (HTML only): http(s) links are rewritten to a signed redirect that records the click, then 302s to the destination. Omitted → the from-domain's default applies. | |
| templateData | No | Shared default merge values for every recipient; a recipient's own templateData overrides these key-by-key. HTML values are auto-escaped. |