Getting Your Contact Form Up & Running

The contact form is handled by an Astro Action (actions.contact) with providers in src/lib/forms/. Multiple topics are supported — each topic can have its own destination email or Slack channel. Open the dialog with a link to href="#contact".

Configure the form in the CMS under Settings > Contact, Social & Forms (provider: mailgun, postmark, or slack). Set secrets in .env locally and in your host’s environment UI for production. CONTACT_FORM_ENDPOINT overrides the CMS provider when set. For Mailgun/Postmark, FROM_EMAIL_ADDRESS must be an authorized sender on your domain.

Mailgun

CONTACT_FORM_ENDPOINT=mailgun
[email protected]
[email protected]
MAILGUN_API_KEY=XXXXXXXXX
MAILGUN_DOMAIN=your-domain.com
MAILGUN_API_URL=https://api.eu.mailgun.net

MAILGUN_API_URL is https://api.eu.mailgun.net (EU) or https://api.mailgun.net (US) — do not include /v3 (the action adds it).

Postmark

Add your server token to the .env.

CONTACT_FORM_ENDPOINT=postmark
[email protected]
[email protected]
POSTMARK_SERVER_TOKEN=XXXXXXXXX

Slack

Create a Slack app, then add the token + channel id to your .env:

CONTACT_FORM_ENDPOINT=slack
SLACK_CHANNEL_ID=XXXXXXXXX
SLACK_TOKEN=XXXXXXXXX

Create your Slack app:

  1. Go to https://api.slack.com/apps
  2. Click “Create an App”
  3. Select “from scratch”
  4. Set name and workspace
  5. Go to OAuth & Permissions
  6. Add Scopes (chat:write, chat:write:customize, chat:write:public)
  7. In the left settings menu select “Install app” and connect it to your workspace
  8. Copy the Bot User OAuth Token — this is your SLACK_TOKEN