logoPay4SaaS
Email

Resend Setup

Resend is used to send email notifications. Currently it powers the contact form — when a user submits a message on /contact, an email is forwarded to your inbox so you never miss it.

Get Your API Key

  1. Sign up at resend.com (free tier: 100 emails/day, 3,000/month)
  2. Go to API Keys in the dashboard
  3. Click Create API Key, give it a name (e.g. pay4saas), select Sending access, Add, and copy the key

Environment Variables

Add the following to your .env.local:

RESEND_API_KEY=re_xxxxx
CONTACT_NOTIFY_EMAIL=you@example.com
VariableDescription
RESEND_API_KEYYour Resend API key (starts with re_)
CONTACT_NOTIFY_EMAILThe email address that receives contact form notifications

How It Works

  1. User submits the /contact form
  2. The message is saved to the contact_messages table in Supabase
  3. An email notification is sent to CONTACT_NOTIFY_EMAIL via Resend (non-blocking — if the email fails, the form submission still succeeds)

The email sending logic is in lib/email.ts.

Custom Domain (Optional)

By default, emails are sent from onboarding@resend.dev. To send from your own domain:

  1. Go to Domains in the Resend dashboard
  2. Add your domain and follow the DNS verification steps (add the TXT and MX records)
  3. Once verified, update the from field in lib/email.ts:
from: 'Pay4SaaS <onboarding@resend.dev>',  
from: 'Pay4SaaS <noreply@yourdomain.com>', 

Testing

After configuring the environment variables, restart the dev server and submit a test message on /contact. You should receive the notification email within seconds.

If the email doesn't arrive, check:

  • RESEND_API_KEY is correct
  • CONTACT_NOTIFY_EMAIL is set
  • Server logs for [Email] prefixed messages

On this page