Email
Email Overview
How transactional email works in Creator with Resend and Mailgun.
Emails are a crucial part of any web application — from verification messages to password resets and subscription notifications.
Creator supports two email providers. Set your choice via environment variable:
NEXT_PUBLIC_EMAIL_SERVICE="resend" # or "mailgun"You only need to configure the provider you pick. The email service uses a provider pattern in lib/services/email-service.ts that selects the right one at runtime.
Pre-built email functions
| Function | Triggered by |
|---|---|
sendOTPEmail | Registration (OTP verification) |
sendWelcomeEmail | OAuth sign-up |
sendPasswordResetEmail | Forgot password |
sendSubscriptionConfirmationEmail | New subscription |
sendSubscriptionCanceledEmail | Subscription canceled |
sendEmailChangeVerification | Email change request |
sendEmailChangedNotification | Email change completed |
sendContactEmail | Contact form submission |
sendPaymentFailedEmail | Payment failed |
All functions are exported from lib/services/email-service.ts.