Install React.Email components
npm i @react-email/components react-email
Write your email
sample-email.tsx
import * as React from "react"; import { Button, Html } from "@react-email/components"; function Email(props) { return ( <Html> <Button href="https://example.com" style={{ background: "#000", color: "#fff", padding: "12px 20px" }} > Click me </Button> </Html> ); } export function renderEmail(inputs) { return render(<Email {...inputs} />); }
Write your workflow
import { renderEmail } from './sample-email.tsx'; import { workflow } from '@novu/framework'; workflow('new-signup', async ({ step, payload }) => { await step.email('send-email', async (inputs) => { return { subject: `Welcome to React E-mail`, body: renderEmail(inputs), } }); });
Was this page helpful?