From b8a34444a9022e755cd79d0b9dbb99615fb3aa13 Mon Sep 17 00:00:00 2001
From: Ledi Hildawan <46273177+ledihildawan@users.noreply.github.com>
Date: Tue, 15 Apr 2025 17:22:00 +0700
Subject: [PATCH] Update react-email.md
How to use in Resend
---
docs/integrations/react-email.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/integrations/react-email.md b/docs/integrations/react-email.md
index 76d10a56..e7e130b2 100644
--- a/docs/integrations/react-email.md
+++ b/docs/integrations/react-email.md
@@ -150,6 +150,9 @@ new Elysia()
``` tsx [Resend]
import { Elysia, t } from 'elysia'
+import * as React from 'react'
+import { renderToStaticMarkup } from 'react-dom/server'
+
import OTPEmail from './emails/otp'
import Resend from 'resend' // [!code ++]
@@ -161,11 +164,13 @@ new Elysia()
// Random between 100,000 and 999,999
const otp = ~~(Math.random() * (900_000 - 1)) + 100_000
+ const html = renderToStaticMarkup()
+
await resend.emails.send({ // [!code ++]
from: 'ibuki@gehenna.sh', // [!code ++]
to: body, // [!code ++]
subject: 'Verify your email address', // [!code ++]
- html: , // [!code ++]
+ html, // [!code ++]
}) // [!code ++]
return { success: true }