Skip to content

feat: add custom headers to send-email and send-batch-emails#189

Open
mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:feat/send-email-headers
Open

feat: add custom headers to send-email and send-batch-emails#189
mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:feat/send-email-headers

Conversation

@mayankbohradev

@mayankbohradev mayankbohradev commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resend's send and batch APIs already accept a headers object for custom MIME headers (for example List-Unsubscribe and X-Entity-Ref-ID).
  • send-email and send-batch-emails did not expose that field, so agents could not set unsubscribe or threading headers through the MCP.
  • Add optional headers (string key/value map) to both tools and pass it through to the Resend SDK payload.
  • Update the README features list to mention custom headers (and idempotency keys, which are already on main).

Why this matters

Without custom headers, MCP users cannot:

  • add one-click unsubscribe headers required for many bulk/transactional flows
  • set X-Entity-Ref-ID to control Gmail threading

This matches Resend's documented Node SDK usage:

await resend.emails.send({
  from: 'Acme <onboarding@resend.dev>',
  to: ['delivered@resend.dev'],
  subject: 'hello world',
  text: 'it works!',
  headers: {
    'List-Unsubscribe': '<https://example.com/unsubscribe>',
    'X-Entity-Ref-ID': 'order-123',
  },
});

Test plan

  • pnpm exec biome check --write .
  • pnpm lint
  • pnpm test (112 passing, including new headers cases)
  • pnpm build

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant