freeemailv0.1.1

Resend Email Integration

Send transactional email with Resend from a Zod-validated server action, with an optional starter form and a signed webhook for delivery events.

$npx cnippet-stack init resend

Want to understand the code? Read the step-by-step guide on next.cnippet.dev →

supports
Next.js
16
Router
app
ORM
none, prisma
prompts
  • Generate a starter email form?(confirm)
  • Add a webhook route for delivery events?(confirm)
environment variables
  • RESEND_API_KEY Resend API key from resend.com/api-keys.
  • EMAIL_FROM Sender address. Must be on a verified domain, or onboarding@resend.dev for local testing.
  • RESEND_WEBHOOK_SECRET Webhook signing secret from resend.com/webhooks.
manual steps
  • Create a Resend API keyrequired

    Create an API key at https://resend.com/api-keys and set RESEND_API_KEY in .env.

  • Choose a sender addressrequired

    Verify a domain at https://resend.com/domains, or use onboarding@resend.dev for local development, and set EMAIL_FROM.

  • Register the webhook endpoint

    Add an endpoint at https://resend.com/webhooks pointing at https://yourdomain.com/api/webhooks/resend, and copy its signing secret into RESEND_WEBHOOK_SECRET.