Newsletter
The Newsletter section follows the same pattern as the Contact form: set a provider, paste the action URL from your ESP’s embed code, save. The form emits whatever input names your provider expects.
The shape
Section titled “The shape”newsletter: { provider: null as "mailchimp" | "convertkit" | "buttondown" | null, heading: "Stay in the loop", subtext: "Get product updates, tips, and insights delivered to your inbox.", placeholder: "Enter your email", buttonLabel: "Subscribe", // actionUrl: "https://your-provider.com/subscribe",}If provider is null (the default) or actionUrl is missing, the form renders disabled with a friendly “configure your provider” hint, so buyers see the slot.
Provider setup
Section titled “Provider setup”Mailchimp
Section titled “Mailchimp”-
In Mailchimp, go to Audience → Signup forms → Embedded forms.
-
Look at the generated HTML. Find the
<form action="…" method="post">tag — that whole URL is youractionUrl. It looks like:https://yourdomain.us21.list-manage.com/subscribe/post?u=abc123&id=def456 -
Set:
newsletter: { provider: "mailchimp", actionUrl: "https://yourdomain.us21.list-manage.com/subscribe/post?u=abc123&id=def456", // … heading / subtext / etc.}The form posts the subscriber email with name="EMAIL" — Mailchimp’s standard.
ConvertKit (Kit)
Section titled “ConvertKit (Kit)”-
In Kit, go to Grow → Landing Pages & Forms → your form → Embed.
-
Pick the HTML tab. Copy the
actionURL — it looks like:https://app.convertkit.com/forms/1234567/subscriptions -
Set:
newsletter: { provider: "convertkit", actionUrl: "https://app.convertkit.com/forms/1234567/subscriptions",}The form posts the subscriber email with name="email_address" — Kit’s standard.
Buttondown
Section titled “Buttondown”-
In Buttondown, go to Settings → Embedding.
-
Your username is the
actionUrl’s last segment:https://buttondown.email/api/emails/embed-subscribe/yourusername -
Set:
newsletter: { provider: "buttondown", actionUrl: "https://buttondown.email/api/emails/embed-subscribe/yourusername",}The form posts the subscriber email with name="email" — Buttondown’s standard.
No provider (null)
Section titled “No provider (null)”newsletter: { provider: null }The form renders with disabled inputs and a small hint pointing to siteConfig.newsletter.provider. Useful pre-launch so you can preview the section without wiring an ESP.
How it works
Section titled “How it works”Open src/components/Newsletter.astro. The frontmatter resolves provider into the correct email-input name (each ESP expects a different one):
const emailInputName = n.provider === "mailchimp" ? "EMAIL" : n.provider === "convertkit" ? "email_address" : n.provider === "buttondown" ? "email" : "email";The form opens in a new tab (target="_blank") so visitors stay on your site after subscribing — they see the provider’s success page in a popup, then close it.
Customize the headings
Section titled “Customize the headings”The four text fields above the form are all in siteConfig.newsletter:
heading: "Stay in the loop",subtext: "Get product updates, tips, and insights delivered to your inbox.",placeholder: "Enter your email",buttonLabel: "Subscribe",Change them once; every theme reads the same fields.
What if I want to use a different ESP?
Section titled “What if I want to use a different ESP?”Add a new branch to the provider switch in Newsletter.astro:
const emailInputName = // …existing branches… n.provider === "mailerlite" ? "fields[email]" : "email";…and update the union type in site.ts. The actionUrl will whatever your ESP’s embed action URL is.
What’s next
Section titled “What’s next”- Customize → Section data — change the newsletter’s heading and CTA copy further.
- Contact form — the same pattern, for the contact section.