Mailer Docs

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

  1. Navigate to API Keys in your Resend dashboard
  2. Create a new API key
  3. 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_xxxxxxxxxxxxx

4. Add Your API Key to Mailer (Optional)

For per-organization API keys:

  1. Go to your Organization Settings
  2. Find the "Email API Key" section
  3. Paste your Resend API key
  4. Click Save

This allows different organizations to use different Resend accounts.

Setting Up Custom Domains

Add Domain to Resend

  1. Go to resend.com/domains
  2. Click Add Domain
  3. Enter your domain name
  4. Add the DNS records provided by Resend

Required DNS Records

Resend will provide you with:

TypePurpose
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

  1. Return to resend.com/domains
  2. Wait for DNS propagation (usually 24-48 hours)
  3. Status will change to "Verified" when ready

Use Custom Domain in Mailer

Once verified:

  1. Go to Organization Settings → Domains
  2. Add your verified domain
  3. Select "resend" as the provider
  4. 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:

  1. Go to Organization Settings → Domains
  2. Edit the domain
  3. Change the provider setting
  4. 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=resend is 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

Resources