Documentation

Guides and references

Backend

Emails

Resend, email service, and templates.

Overview

NextBento uses Resend for transactional emails. Emails are sent via lib/email/service.ts using React Email components.

Service

lib/email/service.ts:

  • sendEmail() — Generic send with React component
  • Renders React to HTML via @react-email/render
  • Plain text fallback for deliverability
  • Idempotency key support
  • Tags for analytics

Templates

TemplateFileUse Case
Billing: Payment Successbilling-payment-success.tsxAfter successful payment
Billing: Payment Failedbilling-payment-failed.tsxPayment failure notification
Billing: Subscription Updatedbilling-subscription-updated.tsxPlan change, cancel, etc.
Team Invitationteam-invitation.tsxInvite team member
Feedback Submissionfeedback-submission.tsxUser feedback received
Feedback Confirmationfeedback-confirmation.tsxThank-you after feedback

Templates live in components/emails/.

Team invitation email template

Configuration

  • RESEND_TOKEN — Resend API key (required)
  • FROM_EMAIL — Sender (e.g. NextBento <noreply@yourdomain.com>)
  • REPLY_TO_EMAIL — Reply-to address
  • NEXT_PUBLIC_APP_URL — Base URL for links

Adding a Template

  1. Create components/emails/my-email.tsx using React Email
  2. Import and call sendEmail({ to, subject, react: <MyEmail /> }) from your API or server action

Best Practices

  • Use Resend domain verification for better deliverability
  • Set up SPF/DKIM/DMARC (see Resend Domain Verification)
  • Keep subject lines clear and non-spammy
  • Include plain text fallback