Docs
Emails
Emails
ZexaNext uses Resend for email service. Resend allows you to send emails using their APIs, add your domain, setup webhooks, send broadcast events and much more.
Resend has a pretty good free tier that allows you to send 3000 emails per month. If you need to send more emails, you can upgrade to a paid plan.
Setup
- Create a new account on Resend
- Click [Domains], then
Add Domain
and add your domain. It's recommended to use a subdomain likemail.yourdomain.com
. Ref Why use a subdomain - Add all the following DNS records (DKIM, SPF, DMARC) in your DNS settings page of the DNS provider. Once all are added, click the ”Verify Records” button above.
- Get you Resend API Key from the Resend dashboard and add it to the
.env
file. - In
@/lib/mail/resend.ts
, update thefrom
email address to your domain email address.
Send Email
You can see the code to send an email using Resend in @/lib/mail/resend.ts
.
This file implements a sendMail
function that takes the email details as an argument and sends the email.
For expample, in @/lib/mail/index.ts
, you can see the code to send verification emails and password reset emails.