React Email + Better-Notify
Write email templates as React components and render them through Better-Notify. Full TypeScript support — your template props are type-checked against your notification schema.
Install
npm install @betternotify/react-emailQuick start
import { reactEmail } from '@betternotify/react-email';
import { WelcomeEmail } from './emails/welcome';
const catalog = rpc.catalog({
welcome: rpc
.email()
.input(z.object({ name: z.string() }))
.subject(({ input }) => `Welcome, ${input.name}`)
.template(({ input }) => reactEmail(WelcomeEmail, { name: input.name })),
});Features
- React components as email templates
- Type-safe template props
- Automatic HTML and plain text rendering
- Pretty-print HTML option
- Works with any email transport