SetupEmail
Setting Up Resend
Set up Resend for reliable email delivery in your Indie Kit application.
Setting Up Resend
This guide will help you set up Resend for reliable email delivery in your application.
Prerequisites
- A Resend account (sign up at resend.com)
- Access to your domain's DNS settings
- Domain verified in Resend
Domain Verification
- Go to Resend Dashboard
- Navigate to Domains > Add Domain
- Follow the DNS verification steps
- Add the provided DNS records to your domain
Implementation
The kit includes Resend integration in src/lib/email/sendMail.ts. Install the dependency if needed:
pnpm add resendThe implementation:
- Development: Logs email details to the console (no API call)
- Production: Sends via Resend when
RESEND_API_KEYis set
Sender name and email come from src/lib/config.ts (appConfig.email.senderName and appConfig.email.senderEmail).
Environment Variables
Add to your .env (template) and set the real value in .env.local:
RESEND_API_KEY=""In .env.local:
RESEND_API_KEY=re_xxxxxxxxxxxxGet your API key from the Resend dashboard.
Testing Email Setup
- Send a test email using Resend dashboard
- Monitor delivery in Resend logs
- Check email headers for proper authentication
Important Notes
- DNS propagation takes time (24-48 hours)
- Monitor email reputation in Resend dashboard
- Keep bounce rate low
- Use production API key in production
Remember to wait for DNS propagation before testing your email setup. Rushing this process can lead to delivery issues!