Skip to content
Astro Rocket
Get in touch

Docs · The theme

Forms

The contact form and the newsletter, sent through Resend, with a double opt-in.

All docs pages

The contact form and the newsletter signup are Astro Actions in src/actions/index.ts. They send through Resend. Set these in .env and at your host:

Variable What it is
RESEND_API_KEY Your Resend key
RESEND_FROM_EMAIL The sender, on a domain you verified in Resend
RESEND_SEGMENT_ID Optional: the segment confirmed subscribers go into
SITE_URL Your site’s address; the newsletter’s confirmation link uses it

The contact form

A message goes to email in site.config.ts. Each address can send five submissions a minute.

The newsletter

The signup sits under each blog post (newsletter in the settings). It’s double opt-in: a signup gets an email with a link to /newsletter/, and the address goes into Resend’s contacts only after the click (src/pages/api/newsletter.ts).

Without Resend

Without RESEND_API_KEY, CONTACT_FORM_ENDPOINT and NEWSLETTER_ENDPOINT send each submission as JSON to an address of your own. With neither, a live site refuses a submission and the form shows an error, rather than losing the message.

Keep the privacy page in step with what your forms do with personal data: its text is in src/i18n/privacy/<language>.astro.