Resend
Setting up and using Resend for sending emails.
While StarterKitPro uses Resend by default, you can integrate other email providers. However, an email service is necessary for features like Magic Links, transactional emails, etc.
Setup
- Create Account: Sign up for a new account on Resend.
- Add Domain: Navigate to the [Domains] section and click
+ Add Domain
. It's highly recommended to use a subdomain (e.g.,resend.yourdomain.com
ormail.yourdomain.com
) for better deliverability. - Verify Domain: Follow the DNS verification steps provided by Resend. Once your DNS records are updated, click
Verify DNS Records
in the Resend dashboard (this might take a few minutes to propagate). - Create API Key: Go to [API Keys] and click
+ Create API Key
. Give it a recognizable name (e.g.,YourAppName Production
) and keep the default permissions. ClickAdd
. - Store API Key: Copy the generated API key immediately (it's shown only once!) and add it to your project's
.env.local
file (or your environment variable management system) asRESEND_API_KEY
:.env.local
Configuration
Ensure your app-config.ts
(or equivalent config file) reflects your Resend setup, particularly the from
addresses and supportEmail
:
Critical Setup
Update fromNoReply
, fromAdmin
, and supportEmail
with your actual domain
and desired email addresses. The optional subdomain
should match the
domain/subdomain you verified in Resend and configured in your DNS.
Sending Emails
StarterKitPro typically uses a centralized function (e.g., sendEmail
in lib/resend.ts
) which utilizes the Resend API (via the resend
npm package) to send emails composed with React Email.
Receiving Emails
Resend does not currently support receiving emails directly.
To handle replies, ensure the reply_to
option is set correctly when sending emails. Our centralized sendEmail
function usually handles this by setting reply_to
to the supportEmail
defined in your app-config.ts
.
Checklist to Avoid Spam Folder (Resend)
- Verified Domain: Ensure your sending domain/subdomain is fully verified in Resend.
- Proper DNS: Correct SPF, DKIM, and DMARC records are essential (Resend guides you through this during domain setup).
- Subdomain: Using a dedicated subdomain (like
mail.yourdomain.com
orresend.yourdomain.com
) is strongly recommended for isolating email reputation. - Reputation: Maintain a good sender reputation by:
- Sending relevant, expected content.
- Managing bounces and complaints promptly.
- Warming up new domains/IPs gradually if sending high volume.
- Content: Avoid spammy content, excessive links, misleading subject lines, and large attachments.
- List Hygiene: Regularly clean your email lists to remove inactive or invalid addresses.
- Unsubscribe Link: Always include a clear and easy-to-use unsubscribe link.