Skip to content

fix: accept display-name reply-to addresses#191

Open
mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:fix/display-name-reply-to
Open

fix: accept display-name reply-to addresses#191
mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:fix/display-name-reply-to

Conversation

@mayankbohradev

@mayankbohradev mayankbohradev commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Display-name address support landed in pieces: batch from was fixed first, then single-email from, while replyTo continued using strict z.email() validation in both email tools. As a result, Support Team <support@example.com> was still rejected by the MCP before Resend could handle it.

This PR closes that remaining gap by aligning single and batch replyTo with the existing broadcast behavior. Bare and display-name values now reach the Resend SDK unchanged.

Related fix history

Reference What it fixed or proposed What remained afterward
#134 Proposed a custom mailbox schema for from and replyTo across single and batch sends. Closed without merging because #162 was considered the simpler duplicate; none of its replyTo changes landed.
#161 Reported the display-name failure on send-email from and suggested symmetric treatment for replyTo. Closed after #162, although #162 did not change the reported single-email path or either replyTo schema.
#162 Changed only send-batch-emails from from z.email() to z.string(). send-email from and both replyTo schemas still rejected display-name values.
#185 Fixed display-name from for send-email. replyTo still used z.email() in both send-email and send-batch-emails.

Final gap closed by this PR

Tool Before After
send-email Display-name replyTo rejected during MCP validation. Bare and display-name replyTo strings are forwarded unchanged.
send-batch-emails Display-name replyTo rejected for each batch item. Bare and display-name replyTo strings are forwarded unchanged per item.

Why this matters

  • Human users can provide a recognizable reply-to identity instead of exposing only a bare mailbox.
  • Agent clients no longer receive an MCP invalid-arguments error for a value the SDK is designed to pass through.
  • Validation behavior is now consistent across single sends, batch sends, and broadcasts.

The scope remains narrow: to, cc, and bcc retain strict email validation, no custom mailbox parser is introduced, and Resend remains responsible for validating the reply-to strings it receives.

Validation

  • pnpm exec biome check --write .
  • pnpm lint (passes; two existing optional-chain warnings remain in unrelated files)
  • pnpm test tests/tools/emails.test.ts (13 passed)
  • pnpm test (116 passed across 13 files)
  • pnpm build

Regression coverage verifies bare and display-name reply-to values for both tools, including the exact payload passed to the SDK mock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant