Skip to content

chore(emails): upgrade react-email to latest#3819

Merged
nicktrn merged 1 commit into
mainfrom
devin/1780487048-upgrade-react-email
Jun 3, 2026
Merged

chore(emails): upgrade react-email to latest#3819
nicktrn merged 1 commit into
mainfrom
devin/1780487048-upgrade-react-email

Conversation

@nicktrn
Copy link
Copy Markdown
Collaborator

@nicktrn nicktrn commented Jun 3, 2026

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

Upgraded the email packages in internal-packages/emails:

Package Before After
@react-email/components 0.0.16 1.0.12
@react-email/render ^0.0.12 ^2.0.8
react-email (CLI) ^2.1.1 ^6.5.0
react-dom (missing) ^18.2.0 (now a required peer of render)

Breaking change handled: render() is now async (Promise<string>) in @react-email/render v1+. Added await in the aws-ses, smtp and null transports. EmailClient and the webapp callers were already async and needed no changes.

Verification:

  • pnpm run typecheck --filter emails
  • pnpm run typecheck --filter webapp (consumer of the emails package) ✅
  • Before/after render comparison: rendered all 11 templates (magic-link, invite, welcome, alert-attempt/run/error-group, deployment-failure/success, mfa-enabled/disabled, bulk-action-complete) to HTML with both the old and new packages and compared them visually + via HTML diff. Output is visually identical. The only HTML changes come from upstream improvements: <Body> now wraps content in a <table>/<td> for better email-client compatibility, an x-apple-disable-message-reformatting meta tag was added, and CSS shorthand (e.g. margin) is now also emitted as longhand. No visual regressions; the CodeBlock/dracula theme, buttons, and row/column layouts all render correctly.

No changeset or .server-changes/ entry is added: emails is a private internal package (not under packages/), and there is no user-facing behavior change.


Changelog

Upgrade react-email and @react-email/{components,render} in internal-packages/emails to their latest versions and adapt the mail transports to the now-async render() API.


Screenshots

Rendered email templates before vs after the upgrade (visually identical):

Before (@react-email/components@0.0.16, render@0.0.12)
before

After (@react-email/components@1.0.12, render@2.0.8)
after

💯

Link to Devin session: https://app.devin.ai/sessions/ccb6f071aeb544768d164c4e7f4e9413
Requested by: @nicktrn

Upgrade @react-email/components 0.0.16 -> 1.0.12, @react-email/render
0.0.12 -> 2.0.8, and the react-email CLI 2.1.1 -> 6.5.0. render() is now
async, so await it in the aws-ses, smtp and null transports. Add
react-dom (+ @types/react-dom) which @react-email/render now requires as
a peer dependency.
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 3, 2026

⚠️ No Changeset found

Latest commit: 30e0583

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d8a870d3-026a-4887-9dd4-5191b62f63af

📥 Commits

Reviewing files that changed from the base of the PR and between 8ab5b48 and 30e0583.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • internal-packages/emails/package.json
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
  • internal-packages/emails/src/transports/smtp.ts
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

Import from @trigger.dev/sdk when writing Trigger.dev tasks. Never use @trigger.dev/sdk/v3 or deprecated client.defineJob

Files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

**/*.{ts,tsx,js,jsx}: Prefer static imports over dynamic imports. Only use dynamic import() when circular dependencies cannot be resolved, code splitting is needed for performance, or the module must be loaded conditionally at runtime
Import subpaths only from packages/core (@trigger.dev/core), never import from the root

Files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
**/*.{js,ts,tsx,jsx,css,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier for code formatting and run pnpm run format before committing

Files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/package.json
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
🧠 Learnings (7)
📓 Common learnings
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3187
File: internal-packages/emails/emails/alert-error-group.tsx:58-58
Timestamp: 2026-03-22T19:26:49.299Z
Learning: In the triggerdotdev/trigger.dev codebase, email template files under `internal-packages/emails/emails/` must use `export default function Email(...)` (default export) because the React Email previewer requires a default export to discover and render templates. Do not flag default exports in these files as violations of the "use named exports" coding guideline.
📚 Learning: 2026-03-22T19:26:49.299Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3187
File: internal-packages/emails/emails/alert-error-group.tsx:58-58
Timestamp: 2026-03-22T19:26:49.299Z
Learning: In the triggerdotdev/trigger.dev codebase, email template files under `internal-packages/emails/emails/` must use `export default function Email(...)` (default export) because the React Email previewer requires a default export to discover and render templates. Do not flag default exports in these files as violations of the "use named exports" coding guideline.

Applied to files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/package.json
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
📚 Learning: 2026-03-22T13:26:12.060Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3244
File: apps/webapp/app/components/code/TextEditor.tsx:81-86
Timestamp: 2026-03-22T13:26:12.060Z
Learning: In the triggerdotdev/trigger.dev codebase, do not flag `navigator.clipboard.writeText(...)` calls for `missing-await`/`unhandled-promise` issues. These clipboard writes are intentionally invoked without `await` and without `catch` handlers across the project; keep that behavior consistent when reviewing TypeScript/TSX files (e.g., usages like in `apps/webapp/app/components/code/TextEditor.tsx`).

Applied to files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
📚 Learning: 2026-03-22T19:24:14.403Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3187
File: apps/webapp/app/v3/services/alerts/deliverErrorGroupAlert.server.ts:200-204
Timestamp: 2026-03-22T19:24:14.403Z
Learning: In the triggerdotdev/trigger.dev codebase, webhook URLs are not expected to contain embedded credentials/secrets (e.g., fields like `ProjectAlertWebhookProperties` should only hold credential-free webhook endpoints). During code review, if you see logging or inclusion of raw webhook URLs in error messages, do not automatically treat it as a credential-leak/secrets-in-logs issue by default—first verify the URL does not contain embedded credentials (for example, no username/password in the URL, no obvious secret/token query params or fragments). If the URL is credential-free per this project’s conventions, allow the logging.

Applied to files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
📚 Learning: 2026-05-18T08:21:27.694Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3632
File: apps/webapp/sentry.server.ts:4-21
Timestamp: 2026-05-18T08:21:27.694Z
Learning: When handling Prisma error P1001 ("Can't reach database server") in TypeScript, don’t assume a single error shape. Prisma can surface P1001 via two different error classes/fields: `PrismaClientKnownRequestError` exposes it as `err.code === "P1001"` (common during mid-query connection drops), while `PrismaClientInitializationError` exposes it as `err.errorCode === "P1001"` (common on client startup failure). Therefore, predicates should use `err.code === "P1001" || err.errorCode === "P1001"`. Do not flag `err.code === "P1001"` as “unreachable/never matches,” as it is expected in production.

Applied to files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
📚 Learning: 2026-05-18T08:21:27.694Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3632
File: apps/webapp/sentry.server.ts:4-21
Timestamp: 2026-05-18T08:21:27.694Z
Learning: When handling Prisma errors for P1001 ("Can't reach database server"), do not assume it only appears under a single property name. Prisma may surface P1001 via either `PrismaClientKnownRequestError` (`err.code === "P1001"`, e.g., mid-query connection drops) or `PrismaClientInitializationError` (`err.errorCode === "P1001"`, e.g., client startup connection failure). To reliably detect the condition, check `err.code === "P1001" || err.errorCode === "P1001"`, and avoid review rules that would incorrectly flag `err.code === "P1001"` as unreachable/never-matching.

Applied to files:

  • internal-packages/emails/src/transports/smtp.ts
  • internal-packages/emails/src/transports/aws-ses.ts
  • internal-packages/emails/src/transports/null.ts
📚 Learning: 2026-04-27T16:40:37.692Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3456
File: apps/webapp/package.json:230-230
Timestamp: 2026-04-27T16:40:37.692Z
Learning: In `apps/webapp/remix.config.js` (Remix 2.x, CJS server build via `serverModuleFormat: "cjs"`), ESM-only npm packages must be added to the `serverDependenciesToBundle` array so esbuild inlines them rather than emitting a `require()` call. The `engines` field allows Node >=18.19.0 || >=20.6.0, so `require(esm)` (Node 20.19+) cannot be relied upon. Packages already listed include p-limit, p-map, axios, and (as of PR `#3456`) uuid. When upgrading a dependency that drops CJS support, always check the post-build artifact for `require("<package>")` and add it to `serverDependenciesToBundle` if present.

Applied to files:

  • internal-packages/emails/package.json
🔇 Additional comments (4)
internal-packages/emails/package.json (1)

14-19: LGTM!

Also applies to: 26-27

internal-packages/emails/src/transports/aws-ses.ts (1)

28-28: LGTM!

internal-packages/emails/src/transports/null.ts (1)

13-15: LGTM!

Also applies to: 20-20

internal-packages/emails/src/transports/smtp.ts (1)

32-32: LGTM!


Walkthrough

This PR upgrades the react-email library dependencies and updates all email transport implementations to work with the new asynchronous rendering API. The package.json is updated with newer versions of @react-email/components (1.0.12), @react-email/render (2.0.8), and react-email (6.5.0), along with adding @types/react-dom to devDependencies. Correspondingly, the AWS SES, SMTP, and null mail transport implementations are refactored to await the render() function calls before using their results in mail payloads, adapting to the now-asynchronous rendering contract.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: upgrading react-email and related packages to their latest versions.
Description check ✅ Passed The description is comprehensive and covers all template sections with thorough testing details, breaking changes explanation, verification steps, and visual comparisons.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1780487048-upgrade-react-email

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@nicktrn nicktrn merged commit 55d85d0 into main Jun 3, 2026
48 checks passed
@nicktrn nicktrn deleted the devin/1780487048-upgrade-react-email branch June 3, 2026 12:24
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.

2 participants