Resend Email Service Guide
Learn how to set up and automate transactional and marketing emails with Resend, including DNS configuration to avoid spam folders.
Create a Resend Account
- Visit resend.com
- Click "Sign up" and create your account
- Verify your email address
- Complete the onboarding process
- You'll receive 3,000 free emails per month on the free tier
Get Your API Key
1. Navigate to API Keys
In your Resend dashboard, go to API Keys
2. Create API Key
- Click "Create API Key"
- Name: "Production" (or your preferred name)
- Permission: "Full Access" for transactional emails
- Click "Create"
3. Copy Your API Key
Existing Buildfast Integration
1. Resend Instance
The Resend client is initialized in lib/resend.ts:
2. Webhook Integration
Transactional emails are sent from the Stripe webhook when a payment is processed:
- Located in app/api/webhooks/route.ts
- Sends payment confirmation emails
- Uses React Email templates for beautiful HTML emails
- Handles different payment statuses
3. React Email Template
The email template is in emails/vercel-email.tsx and includes:
- Company logo
- Dynamic headings based on payment status
- Formatted payment amounts
- Professional email layout
Environment Variables
Add to your .env file:
RESEND_API_KEY=re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
DNS Configuration (Avoid Spam Folders)
1. Add Your Domain to Resend
- Go to Domains in your Resend dashboard
- Click "Add Domain"
- Enter your domain (e.g., yourdomain.com)
- Click "Add"
2. Configure DNS Records
Add these records to your DNS provider (e.g., Vercel Domains):
SPF Record:
DKIM Records (3 CNAME records):
resend2._domainkey → resend2._domainkey.yourdomain.com.dkim.amazonses.com
resend3._domainkey → resend3._domainkey.yourdomain.com.dkim.amazonses.com
DMARC Record (Optional but recommended):
3. Verify Domain
- Return to Resend dashboard
- Click "Verify DNS records"
- Wait for all records to show green checkmarks
- DNS propagation can take up to 48 hours
Sending Emails
1. Basic Email
2. React Email Template
3. Batch Emails (Marketing)
Best Practices
Use a subdomain for transactional emails
e.g., noreply@mail.yourdomain.com
Always include an unsubscribe link
Required for marketing emails, good practice for all
Test emails before sending
Use Resend's test mode or send to yourself first
Monitor your sender reputation
Check bounce rates and spam complaints regularly
Use React Email for consistent templates
Ensures emails look great across all clients
Test Your Integration
- Start your development server:pnpm dev
- Make a test purchase through Stripe Checkout
- Check your email for the payment confirmation
- Verify the email arrives and displays correctly
- Check Resend dashboard for email logs and status
- Monitor for any bounce backs or delivery issues