Skip to content

fix: avoid mutating payloads in emails, broadcasts, and templates#862

Merged
gabrielmfern merged 3 commits into
resend:canaryfrom
Shubhdeep12:fix/payload-mutation
May 18, 2026
Merged

fix: avoid mutating payloads in emails, broadcasts, and templates#862
gabrielmfern merged 3 commits into
resend:canaryfrom
Shubhdeep12:fix/payload-mutation

Conversation

@Shubhdeep12
Copy link
Copy Markdown
Contributor

@Shubhdeep12 Shubhdeep12 commented Mar 2, 2026

  • used cloned bodies / local html variables instead of writing payload.html when react is provided.
  • added a test

Summary by cubic

Stop mutating request payloads in emails, broadcasts, and templates when rendering React to HTML. This prevents side effects and keeps input objects unchanged.

  • Bug Fixes
    • Use local html variables/body copies instead of writing to payload.html in emails.create, broadcasts.create/update, and templates.create.
    • Added tests to verify payload immutability for emails, broadcasts, and templates. No API changes.

Written for commit c6dcfb4. Summary will update on new commits.

@Shubhdeep12 Shubhdeep12 requested a review from a team as a code owner March 2, 2026 15:52
@Shubhdeep12 Shubhdeep12 requested a review from rehanvdm March 2, 2026 15:52
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 2, 2026

Open in StackBlitz

npm i https://pkg.pr.new/resend@862

commit: 1f7f772

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@gabrielmfern gabrielmfern changed the title fix: to avoid mutating payloads in emails, broadcasts, and templates fix: avoid mutating payloads in emails, broadcasts, and templates Mar 2, 2026
Comment thread src/templates/templates.spec.ts
@rehanvdm rehanvdm removed their request for review March 5, 2026 17:16
@Shubhdeep12 Shubhdeep12 requested a review from gabrielmfern March 6, 2026 01:39
@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label May 16, 2026
Copy link
Copy Markdown
Member

@gabrielmfern gabrielmfern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@gabrielmfern gabrielmfern merged commit ebdb2d3 into resend:canary May 18, 2026
9 checks passed
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.

2 participants