fix: align send-batch-emails with batch API tag support#188
Conversation
Mirror send-email attachment handling in the batch send MCP tool so scheduledAt, tags, and attachments are all passed through to the API. Co-authored-by: cpenned <cpenned@users.noreply.github.com>
Co-authored-by: cpenned <cpenned@users.noreply.github.com>
mayankbohradev
left a comment
There was a problem hiding this comment.
Thanks for working on batch parity with send-email.
I double-checked this against current Resend docs and the official SDKs before commenting.
Public docs still say batch does not support attachments
- API reference limitations: https://resend.com/docs/api-reference/emails/send-batch-emails
The
attachmentsandscheduled_atfields are not supported yet. - Batch sending guide: https://resend.com/docs/dashboard/emails/batch-sending
The
attachmentsfield is not supported yet - Attachments guide: https://resend.com/docs/dashboard/emails/attachments
We currently do not support sending attachments when using our batch endpoint.
- Official skills/reference also routes attachment sends to single
POST /emails, not batch: https://github.com/resend/resend-skills/blob/main/skills/resend/references/sending/overview.md
Official SDKs still omit attachments from batch types
resend-node(CreateBatchEmailOptions):
Omit<CreateEmailOptions, 'attachments' | 'scheduledAt'>
with comment: “not supported in the batch API”
https://github.com/resend/resend-node/blob/main/src/batch/interfaces/create-batch-options.interface.ts- Installed
resend@6.17.xin this repo matches that typing. - Historical confirmation from maintainers on
resend-node#409: attachments are not supported on the batch endpoint yet.
Why this matters for this PR
The PR description says this aligns with an updated batch API, and the new tests mock batch.send, so they prove MCP pass-through — not that the live API accepts attachments. If the API still rejects them, agents would get a runtime failure after the MCP accepts the args.
Questions for maintainers:
- Has batch attachments shipped on the API already, and docs/SDKs just haven’t caught up?
- If not, should we hold exposing
attachmentsonsend-batch-emailsuntil the API supports it (or clearly document that it will fail upstream)?
Smaller related note: send-batch-emails already exposes scheduledAt, which has the same documented limitation. Adding attachments makes that gap more user-facing.
Happy to re-check if there’s an internal/API update I’m missing.
Remove unsupported scheduledAt and attachments from send-batch-emails. Batch send only supports tags beyond the core email fields. Co-authored-by: cpenned <cpenned@users.noreply.github.com>
Co-authored-by: cpenned <cpenned@users.noreply.github.com>
Summary
Aligns
send-batch-emailswith the Resend batch API. Only tags are supported as an extra per-email field.Changes
scheduledAtfrom the batch email schema and handler (was incorrectly exposed)tagsfield description withsend-emailresend.batch.send