Learn how to send an email using React Email and the Plunk Node.js SDK.
npm install @plunk/node @react-email/components
.jsx
.tsx
import * as React from "react"; import { Html, Button } from "@react-email/components"; export function Email(props) { const { url } = props; return ( <Html lang="en"> <Button href={url}>Click me</Button> </Html> ); } export default Email;
import Plunk from "@plunk/node"; import { render } from "@react-email/components"; import { Email } from "./email"; const plunk = new Plunk(process.env.PLUNK_API_KEY); const emailHtml = await render(<Email url="https://example.com" />); plunk.emails.send({ to: "hello@useplunk.com", subject: "Hello world", body: emailHtml, });