Transactional emails are sent using Resend.
Setup
- Create a Resend account.
- Get your API Key.
- Add it to your
.envfile:
RESEND_API_KEY="re_123456789"
Sending Emails
You can send emails using the Resend SDK.
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: 'onboarding@resend.dev',
to: 'user@example.com',
subject: 'Welcome!',
html: '<p>Thanks for signing up!</p>'
});
Templates
It is recommended to use React components for your email templates. You can create them in src/components/emails/ and render them to HTML before sending.