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

##  Checklist

- [x] I have followed every step in the [contributing
guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md)
- [x] The PR title follows the convention.
- [x] 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`)
This commit is contained in:
nicktrn
2026-06-03 13:24:55 +01:00
committed by GitHub
parent 8ab5b484bf
commit 55d85d0b23
5 changed files with 825 additions and 1768 deletions
+6 -4
View File
@@ -11,18 +11,20 @@
},
"dependencies": {
"@aws-sdk/client-sesv2": "^3.716.0",
"@react-email/components": "0.0.16",
"@react-email/render": "^0.0.12",
"@react-email/components": "1.0.12",
"@react-email/render": "^2.0.8",
"nodemailer": "^8.0.6",
"react": "^18.2.0",
"react-email": "^2.1.1",
"react-dom": "^18.2.0",
"react-email": "^6.5.0",
"resend": "^3.2.0",
"tiny-invariant": "^1.2.0",
"zod": "3.25.76"
},
"devDependencies": {
"@types/nodemailer": "^8.0.0",
"@types/react": "18.2.69"
"@types/react": "18.2.69",
"@types/react-dom": "18.2.7"
},
"engines": {
"node": ">=18.0.0"
@@ -25,7 +25,7 @@ export class AwsSesMailTransport implements MailTransport {
to,
replyTo: replyTo,
subject,
html: render(react),
html: await render(react),
});
}
catch (error) {
@@ -10,12 +10,14 @@ export class NullMailTransport implements MailTransport {
}
async send({to, subject, react}: MailMessage): Promise<void> {
const plainText = await render(react, {
plainText: true,
});
console.log(`
##### sendEmail to ${to}, subject: ${subject}
${render(react, {
plainText: true,
})}
${plainText}
`);
}
@@ -29,7 +29,7 @@ export class SmtpMailTransport implements MailTransport {
to,
replyTo: replyTo,
subject,
html: render(react),
html: await render(react),
});
} catch (error) {
if (error instanceof Error) {
+812 -1759
View File
File diff suppressed because it is too large Load Diff