fix: accept display-name reply-to addresses#191
Open
mayankbohradev wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Display-name address support landed in pieces: batch
fromwas fixed first, then single-emailfrom, whilereplyTocontinued using strictz.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
replyTowith the existing broadcast behavior. Bare and display-name values now reach the Resend SDK unchanged.Related fix history
fromandreplyToacross single and batch sends.replyTochanges landed.send-emailfromand suggested symmetric treatment forreplyTo.replyToschema.send-batch-emailsfromfromz.email()toz.string().send-emailfromand bothreplyToschemas still rejected display-name values.fromforsend-email.replyTostill usedz.email()in bothsend-emailandsend-batch-emails.Final gap closed by this PR
send-emailreplyTorejected during MCP validation.replyTostrings are forwarded unchanged.send-batch-emailsreplyTorejected for each batch item.replyTostrings are forwarded unchanged per item.Why this matters
The scope remains narrow:
to,cc, andbccretain 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 buildRegression coverage verifies bare and display-name reply-to values for both tools, including the exact payload passed to the SDK mock.