Skip to content

Conversation

@joaopcm
Copy link
Member

@joaopcm joaopcm commented Nov 3, 2025

Integrate with Templates API so users can easily turn React Email templates into actual Resend templates

CleanShot.2025-11-03.at.15.10.16.mp4

Summary by cubic

Integrated the Resend Templates API into the preview server with a new Resend tab for single or bulk template uploads. The React Email CLI now passes the API key to the server, and a safe server action creates templates.

  • New Features

    • Resend toolbar tab with Upload and Bulk Upload actions.
    • Server action: exportSingleTemplate (next-safe-action + zod).
    • React Email CLI: email resend setup <API_KEY> saves RESEND_API_KEY for the preview server.
    • UI feedback for uploading/success/error and “Open in Resend” link.
    • Icons, sleep util, and a toolbar provider to detect API key.
    • Uploads HTML only; variables not supported yet.
  • Migration

    • Run: email resend setup YOUR_API_KEY to configure RESEND_API_KEY.

Written for commit dcd97ea. Summary will update automatically on new commits.

@joaopcm joaopcm self-assigned this Nov 3, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

🦋 Changeset detected

Latest commit: 57a631a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@react-email/preview-server Minor
react-email Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-email Ready Ready Preview Comment Nov 6, 2025 1:58pm
react-email-demo Ready Ready Preview Comment Nov 6, 2025 1:58pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 3, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email/@react-email/preview-server@2634
npm i https://pkg.pr.new/resend/react-email@2634

commit: 57a631a

Copy link
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.

4 issues found across 15 files

Prompt for AI agents (all 4 issues)

Understand the root cause of the following 4 issues and fix them.


<file name="packages/preview-server/src/components/icons/icon-cloud-alert.tsx">

<violation number="1" location="packages/preview-server/src/components/icons/icon-cloud-alert.tsx:15">
Move the props spread above the stroke defaults so this icon matches the other icons’ override behavior; right now this one uniquely allows consumers to replace the stroke settings.</violation>
</file>

<file name="packages/preview-server/scripts/setup-resend.mts">

<violation number="1" location="packages/preview-server/scripts/setup-resend.mts:18">
Running this script without an argument overwrites an existing RESEND_API_KEY with an empty value, wiping the configured credential. Please guard the update so the existing key is preserved when apiKey is missing.</violation>
</file>

<file name="packages/preview-server/src/components/toolbar/resend.tsx">

<violation number="1" location="packages/preview-server/src/components/toolbar/resend.tsx:132">
`Bulk Upload` only flattens the root directory and its first-level subdirectories, so templates in deeper folders are never exported. Please recurse through nested `subDirectories` before queuing uploads.</violation>
</file>

<file name="packages/preview-server/src/actions/bulk-import-templates.ts">

<violation number="1" location="packages/preview-server/src/actions/bulk-import-templates.ts:23">
Rule violated: **API Key Permission Check SDK Methods**

New usage of `resend.templates.create` introduces a Resend API capability that may require additional template-management permissions. Please confirm that the production RESEND_API_KEY has the necessary scope to create templates so these exports don’t fail after deployment.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@joaopcm joaopcm changed the title feat: initial templates api integration feat(preview-server): templates api integration Nov 3, 2025
@gabrielmfern gabrielmfern merged commit 161083a into canary Nov 6, 2025
15 of 18 checks passed
@gabrielmfern gabrielmfern deleted the feat/templates-integration branch November 6, 2025 15:55
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.

3 participants