Resend Integration
Resend is an alternative email provider you can use with Mailer. While AWS SES is the default provider, Resend offers a simpler setup process with a developer-friendly API.
Note: Resend is not the default provider. You'll need to configure it explicitly to use it.
Why Use Resend?
- Simple setup - Get started in minutes with minimal configuration
- Developer-friendly - Clean API and excellent documentation
- Built-in analytics - Access delivery metrics in the Resend dashboard
Setup Guide
1. Create a Resend Account
Go to resend.com and sign up for an account.
2. Get Your API Key
- Navigate to API Keys in your Resend dashboard
- Create a new API key
- Copy the key (starts with
re_)
Security Tip: Create a key with only "Send emails" permissions for production use.
3. Configure Environment Variables
Add Resend as your email provider:
# Set Resend as the default provider
DEFAULT_EMAIL_PROVIDER=resend
# Your Resend API key
RESEND_API_KEY=re_xxxxxxxxxxxxx4. Add Your API Key to Mailer (Optional)
For per-organization API keys:
- Go to your Organization Settings
- Find the "Email API Key" section
- Paste your Resend API key
- Click Save
This allows different organizations to use different Resend accounts.
Setting Up Custom Domains
Add Domain to Resend
- Go to resend.com/domains
- Click Add Domain
- Enter your domain name
- Add the DNS records provided by Resend
Required DNS Records
Resend will provide you with:
| Type | Purpose |
|---|---|
| TXT (SPF) | Email authentication |
| TXT (DKIM) | Email signing |
| TXT (DMARC) | Domain policy (recommended) |
Add these records to your DNS provider (Cloudflare, Route53, Namecheap, etc.).
Verify Domain
- Return to resend.com/domains
- Wait for DNS propagation (usually 24-48 hours)
- Status will change to "Verified" when ready
Use Custom Domain in Mailer
Once verified:
- Go to Organization Settings → Domains
- Add your verified domain
- Select "resend" as the provider
- Click Set Active
Switching Between Providers
You can use both SES and Resend in the same Mailer installation:
- Set different providers per domain
- Use SES as default, Resend for specific organizations
- Migrate gradually by switching domains one at a time
To switch a domain's provider:
- Go to Organization Settings → Domains
- Edit the domain
- Change the provider setting
- Save changes
Troubleshooting
Domain Not Verifying
- Check DNS records are correctly added
- Wait 24-48 hours for propagation
- Verify TXT record format is correct
- Use MXToolbox to check DNS
API Key Not Working
- Verify the key is correctly pasted (no extra spaces)
- Check key has "Send emails" permission
- Ensure key hasn't been revoked in Resend dashboard
- Confirm
DEFAULT_EMAIL_PROVIDER=resendis set
Emails Not Sending
- Check the Resend dashboard for error logs
- Verify domain is verified in Resend
- Ensure recipient email is valid
- Check application logs for detailed errors
Low Deliverability
- Ensure SPF, DKIM, DMARC are all configured
- Clean your email lists regularly
- Warm up new domains gradually
- Monitor and remove hard bounces