GuidesEmail
Sending Emails
This guide will help you learn how to send marketing emails using Resend in the Next.js Supabase AI template, covering setup and implementation details.
Overview
In the Next.js Supabase AI template, you can utilize the Resend mail provider to send marketing emails. This guide will walk you through the setup and implementation process.
Prerequisites
Before you begin, ensure that you have completed the following:
- Resend Account Setup: Create and configure your Resend account. You must have a valid Resend account to send emails.
- Email Template: Prepare your email template to be used in the invitation emails.
Sending Emails with Resend
To send marketing emails using Resend, you will use the resend.emails.send
method. Follow the steps below for implementation:
Implementation
Use the following code snippet to send an email invitation:
Parameters Explained
from
: The email address of the user (invitee), retrieved from the environment variableenv.RESEND_FROM_DOMAIN
.to
: The email address of the user you want to invite, represented by the variableemailTo
.subject
: The subject line of the email.react
: The content of the email, which should use an email template. Import theInviteEmailTemplate
from the designated folder.
Additional Resources
For more information, refer to following resources: