Handlebars + Better-Notify
Use Handlebars templates for simple, logic-light email rendering. Great for teams that prefer HTML templates over component frameworks.
Install
npm install @betternotify/handlebarsQuick start
import { handlebarsTemplate } from '@betternotify/handlebars';
const catalog = rpc.catalog({
invite: rpc
.email()
.input(z.object({ inviterName: z.string(), teamName: z.string() }))
.subject(({ input }) => `${input.inviterName} invited you to ${input.teamName}`)
.template(handlebarsTemplate('<h1>Welcome, {{inviterName}}</h1><p>Join {{teamName}} today.</p>')),
});Features
- Handlebars template syntax
- Partials and helpers
- HTML and plain text output
- Type-safe template context
- Works with any email transport