Wiring up transactional email — the kit doesn't ship any by default.
The kit doesn't include a transactional email library. Auth emails
(verification codes, magic links, password resets) are handled out of the
box by Clerk, and the contact form posts directly to
Formspree (NEXT_PUBLIC_FORMSPREE_ENDPOINT) —
that covers it. If additional transactional emails are required (e.g.
welcome, invite, or notification emails), refer to the provider
integrations below.
Both providers below fit a serverless Next.js app well — no persistent connection required, simple HTTP-based SDKs. Each needs:
- a server-only secret in
.env— see Adding your own variable; - a
sendEmail()wrapper undersrc/lib/email/, the waysrc/lib/billing/stripe/client.tswraps the Stripe SDK; - a call site — a Server Action, or the Stripe webhook handler
(
src/lib/billing/stripe/payment-service.ts) for emails such as a payment receipt.
Resend
Developer-friendly API, React Email support.
Install the SDK, and add RESEND_API_KEY to .env and to the schema in
src/lib/env.server.ts:
pnpm add resendCreate src/lib/email/client.ts:
import { Resend } from 'resend'
import { serverEnv } from '@/lib/env.server'
const resend = new Resend(serverEnv.RESEND_API_KEY)
export function sendEmail(options: {
to: string
subject: string
html: string
}) {
return resend.emails.send({ from: 'you@yourdomain.com', ...options })
}Postmark
Deliverability-focused, long-standing transactional provider.
Install the SDK, and add POSTMARK_SERVER_TOKEN to .env and to the schema
in src/lib/env.server.ts:
pnpm add postmarkCreate src/lib/email/client.ts:
import { ServerClient } from 'postmark'
import { serverEnv } from '@/lib/env.server'
const client = new ServerClient(serverEnv.POSTMARK_SERVER_TOKEN)
export function sendEmail(options: {
to: string
subject: string
html: string
}) {
return client.sendEmail({
From: 'you@yourdomain.com',
To: options.to,
Subject: options.subject,
HtmlBody: options.html,
})
}Resend is the more common default for new projects; reach for Postmark if deliverability track record and bounce/complaint handling matter more than DX.