@veloxts/mail provides email sending with React templates.
Installation
Section titled “Installation”pnpm add @veloxts/mailQuick Start
Section titled “Quick Start”import { mailPlugin } from '@veloxts/mail';
app.register(mailPlugin, { driver: 'resend', config: { apiKey: process.env.RESEND_API_KEY }, defaults: { from: 'hello@example.com' },});Define Templates
Section titled “Define Templates”import { defineMail } from '@veloxts/mail';import { Html, Body, Text } from '@react-email/components';
export const WelcomeEmail = defineMail({ name: 'welcome', schema: z.object({ name: z.string(), activationUrl: z.string().url(), }), subject: ({ name }) => `Welcome, ${name}!`, template: ({ name, activationUrl }) => ( <Html> <Body> <Text>Hello {name}!</Text> <Text>Click here to activate: {activationUrl}</Text> </Body> </Html> ),});Send Email
Section titled “Send Email”await ctx.mail.send(WelcomeEmail, { to: 'user@example.com', data: { name: 'Alice', activationUrl: 'https://...' },});Drivers
Section titled “Drivers”mailPlugin({ driver: 'smtp', config: { host: 'smtp.example.com', port: 587, auth: { user: '...', pass: '...' }, },})Resend
Section titled “Resend”mailPlugin({ driver: 'resend', config: { apiKey: process.env.RESEND_API_KEY },})Next Steps
Section titled “Next Steps”- Queue - Send emails in background
- Ecosystem Overview - All packages