Skip to main content

Email Config

Who emails come from, where replies go.

File: config/email.config.ts

Controls the From address, Reply-To address, and the signature used in every email the site sends (welcome, submission confirmation, admin approvals, newsletter, …).

The only supported provider today is Resend.

Quick setup

1. Create a Resend account

resend.com → sign up (free tier: 3,000 emails/month, 100/day).

2. Create an API key

Resend Dashboard → API KeysCreate API Key → full access. Copy the key (starts with re_).

Resend API keys page

Paste into .env.local:

RESEND_API_KEY=re_...

3. Verify your domain (required for production)

Without domain verification, all emails go from onboarding@resend.dev and look suspicious.

Resend → DomainsAdd Domain → enter e.g. mydirectory.com. Resend shows you DNS records (TXT, MX, DKIM). Add them in your DNS provider (Cloudflare, Namecheap, etc.).

Once all DNS records show green check marks, you can send from anyname@mydirectory.com.

Resend verified domain page

The config file

config/email.config.ts
export const emailConfig: EmailConfig = {
  provider: 'resend',
 
  from: {
    name: siteConfig.name,  // pulled from site.config.ts
    email: process.env.RESEND_PRODUCTION_FROM || `hello@${yourdomain}`,
  },
 
  replyTo: siteConfig.contact.email,
 
  teamSignature: `The ${siteConfig.name} Team`,
};
FieldWhat it does
providerAlways 'resend' for now.
from.nameDisplay name in the recipient's inbox.
from.emailEmail address emails come from.
replyToWhere user replies land.
teamSignatureThe sign-off at the bottom of emails.

Environment variables (all optional overrides)

VariableWhat it overrides
RESEND_PRODUCTION_FROMThe production "From" address.
RESEND_DEV_FROMThe dev-mode "From" address (default: onboarding@resend.dev).
RESEND_FROM_EMAILMaster override — wins over both above.
RESEND_DEV_REDIRECTtrue (default) redirects all dev emails to one address for safety.
RESEND_DEV_REDIRECT_TOEmail address dev messages get redirected to.

Why dev redirection matters

In development you often test flows that send emails. Without redirection, you risk emailing real users with test content. Keep RESEND_DEV_REDIRECT=true and point RESEND_DEV_REDIRECT_TO at your own inbox.

.env.local
RESEND_DEV_REDIRECT=true
RESEND_DEV_REDIRECT_TO=you@example.com

With AI

AI Prompt· Configure email sender + signature

Update config/email.config.ts for my brand:

  • provider: "resend" (keep as-is)
  • from.name: "{sender display name shown in inbox, usually brand name}"
  • from.email: "{hello@yourdomain.com — must match a verified Resend domain}"
  • replyTo: "{hello@yourdomain.com — where user replies go}"
  • teamSignature: "{sign-off, e.g. "The Brand Team"}"

Also set these env vars in .env.local (paste the values for me to review):

Preserve the EmailConfig type. Don't touch getFromAddress() helper.

See also