Resend Setup (Email)

NextGenKit uses Resend for transactional emails with React Email templates.

1. Get Your API Key

  1. Sign up at resend.com
  2. Go to API Keys → Create a new key
  3. Add it to .env.local as RESEND_API_KEY

2. Verify Your Domain

For production, verify your sending domain in Resend Dashboard → Domains. Set EMAIL_FROM to an address on that domain.

3. Email Templates

Templates live in the emails/ directory using React Email components:

  • emails/welcome.tsx — Sent on user signup
  • emails/subscription-confirmed.tsx — After successful payment
  • emails/payment-failed.tsx — On failed invoice

4. Preview Templates

pnpm email:dev

Opens a browser preview at localhost:3001 where you can see all templates.

5. Sending Emails

import { resend } from "@/lib/email"
import { WelcomeEmail } from "@/emails/welcome"

await resend.emails.send({
  from: env.EMAIL_FROM,
  to: user.email,
  subject: "Welcome to NextGenKit",
  react: WelcomeEmail({ name: user.name }),
})