Resend + React Email
import { Resend } from "resend";
import { WelcomeEmail } from "./emails/welcome";
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: "noreply@example.com",
to: "user@gmail.com",
subject: "환영합니다!",
react: WelcomeEmail({ name: "김철수" }),
});
React Email 템플릿
import { Html, Head, Body, Text, Button } from "@react-email/components";
export function WelcomeEmail({ name }) {
return (
<Html>
<Body style={{ fontFamily: "sans-serif" }}>
<Text>안녕하세요 {name}님</Text>
<Button href="https://example.com">시작하기</Button>
</Body>
</Html>
);
}
댓글 0