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 (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.

On desktop the dialog shows an optional side image from the CMS; on mobile the form is shown alone.

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.

POSTMARK_SERVER_TOKEN=XXXXXXXXX

Slack

For slack to work you first need to create an app, then add the slack token + channel id to your .env

SLACK_CHANNEL_ID=XXXXXXXXX
SLACK_TOKEN=XXXXXXXXX

Create your slack app:

  1. Go to https://api.slack.com/apps
  2. Click “Create an App” Button.
  3. Select “from scratch”
  4. Set name and workspace
  5. Go to OAuth & Permissions menu.
  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. Now you have your Bot User OAuth Token this is your SLACK_TOKEN