This guide will help you set up the Resend email service in just a few minutes.
- Go to https://resend.com/signup
- Create a free account (no credit card required)
- Verify your email address
- Navigate to API Keys in the dashboard
- Click Create API Key
- Copy your API key (starts with
re_)
Create a .env.local file in the root directory with:
# Resend Configuration
RESEND_API_KEY=re_your_api_key_here
FROM_EMAIL=onboarding@resend.dev # Use this for testing
NEXT_PUBLIC_SITE_URL=http://localhost:3000Note: For production, you'll need to verify your own domain with Resend and use your domain email address.
-
Start your development server:
npm run dev
-
Navigate to http://localhost:3000
-
Scroll to the footer
-
Enter your email and click "Subscribe"
-
Check your inbox for the confirmation email!
For production deployment:
-
Verify Your Domain in Resend dashboard
- Add DNS records (SPF, DKIM) provided by Resend
- Wait for verification (usually a few minutes)
-
Update Environment Variables
FROM_EMAIL=newsletter@yourdomain.com NEXT_PUBLIC_SITE_URL=https://yourblog.com
-
Deploy your application
Once set up, you have:
✅ Subscription Management
- Users can subscribe via footer form
- Automatic welcome emails
- One-click unsubscribe
✅ Post Notifications
- New posts automatically notify all subscribers
- Beautiful email templates with post preview
- Batch sending for scalability
✅ Admin Onboarding
- New admins receive welcome emails
- Login credentials included
- Security reminders
Emails not sending?
- Check that
RESEND_API_KEYis set correctly - Verify the API key is active in Resend dashboard
- Check server logs for error messages
Emails going to spam?
- Verify your domain in Resend (for production)
- Ensure FROM_EMAIL matches verified domain
- Add SPF and DKIM DNS records
Database errors?
- The
subscriberstable is created automatically - If issues persist, check PostgreSQL connection
- Verify database is accessible
Resend Free Tier:
- 100 emails per day
- 3,000 emails per month
- Perfect for testing and small blogs
Resend Pro ($20/month):
- 50,000 emails per month
- Higher sending rates
- Better for growing blogs
- Read the full EMAIL_SERVICE.md documentation
- Customize email templates in
src/lib/email.ts - Set up domain verification for production
- Monitor email delivery in Resend dashboard
- 📖 Full documentation: EMAIL_SERVICE.md
- 🌐 Resend docs: https://resend.com/docs
- 💬 Resend support: Available in their dashboard
That's it! Your email service is now ready to use. 🎉