AFI AFI

Mailcoach

Estimated reading: 2 minutes Updated August 1, 2026

Mailcoach is a self-hosted email-marketing platform from Spatie, popular as a privacy-friendly alternative to SaaS tools. Advanced Form Integration sends form submissions to your Mailcoach instance as new subscribers on a chosen mailing list.

What you’ll need

  • A running Mailcoach instance.
  • Your Mailcoach API Domain (e.g., mail.yoursite.com).
  • A Mailcoach Personal Access Token (API Settings).
  • The Advanced Form Integration plugin installed and activated.

Get your Mailcoach API credentials

  1. Log in to your Mailcoach instance.
  2. Go to API Settings.
  3. Note your API Domain (the host of your Mailcoach install).
  4. Generate or copy your Personal Access Token.

Connect Mailcoach to AFI

  1. In WordPress, go to AFI → Settings.
  2. Enable Mailcoach and click Save Changes.
  3. Open the Mailcoach tab.
  4. Enter the API Domain and API Token.
  5. Click Save Changes.

Create the integration

  1. Go to AFI → Add New.
  2. Configure the trigger.
  3. In Action → Platform, select Mailcoach.
  4. In Task, choose Add Subscriber.
  5. Pick the Mailing List: AFI loads your lists from Mailcoach.
  6. Map the form fields:
  • email (required), first_name, last_name.
  1. Optional: configure Conditional Logic.
  2. Click Save Integration.

Screenshot: AFI field-mapping screen with Mailcoach list and subscriber fields visible

Tasks supported

Add Subscriber

Adds the form submitter as a subscriber on the chosen Mailcoach mailing list. Re-submissions update the existing subscriber rather than creating duplicates.

Conditional logic example

Subscribe to your “EU subscribers” Mailcoach list only when the form’s region field equals “EU”. Other regions go to language-specific lists via separate integrations.

Troubleshooting

Integration doesn’t fire

Open AFI → Log and find the most recent entry. The log shows the request payload sent to Mailcoach and the response received, usually pointing straight at the cause.

Mailcoach instance not reachable

Self-hosted Mailcoach must be publicly accessible from your WordPress server. If Mailcoach sits behind HTTP basic auth or an IP allowlist, whitelist your WordPress server IP at the web-server level.

Related docs