Campaign Monitor
Add, update or unsubscribe Campaign Monitor subscribers from your forms, with answers mapped to list custom fields.
Campaign Monitor is an add-on for Forms. Each form gets a Campaign Monitor panel where you add actions: create or update a subscriber, update someone already on a list, or unsubscribe them. The form works as before, and if Campaign Monitor turns a subscriber away, the submission is still saved.
Connect Campaign Monitor
In Campaign Monitor, click your profile image, then Account settings → API keys. Click Show API key, or Generate API key if you don't have one yet. The Client ID for each client is listed on the same page.
In WordPress, open XPAC → Integrations → Campaign Monitor. Paste the values into API key and Client ID, then save. Forms can use only this client's lists.
Click Test connection. It reads the client's lists with the saved values and reports how many it found. It sends nothing.
Both values stay visible to admins on this screen. If Campaign Monitor refuses them, you see its own message. A wrong Client ID only breaks the list picker in the form editor: actions you already saved keep sending.
Add it to a form
Edit the form, open the Campaign Monitor panel in the sidebar and click Add Campaign Monitor action.
- Action: Create or update subscriber, Update existing subscriber (adds nobody new), or Unsubscribe.
- List: one of the client's lists. Lists are kept for 10 minutes; click Reload from Campaign Monitor to fetch them again.
- Re-add people who unsubscribed before: off by default. Also re-adds bounced and suppressed addresses. Turn it on only when the form asks for fresh consent.
- Restart their automated emails: shown when the option above is on. Without it, re-added people get only the emails left in the sequence.
- Consent to track opens and clicks: No (the default), Yes, Keep existing consent (new subscribers count as Yes), or Use a form field.
- Consent field: with Use a form field. A blank, unchecked, "no", "false", "off" or "0" answer means No. Anything else means Yes.
- Field mapping: pair each Form field with a Campaign Monitor field: Email, Name, or one of the list's custom fields, shown with its type. Click Reload fields after adding a field in Campaign Monitor.
- Email address field: replaces the mapping for Unsubscribe, which needs only the address.
Save the action, then save the form. Save stays off until you pick a list and map a form field to Email, and while a row points at a field that isn't on the list or that another row already fills. Make the email field required.
One form field can fill several Campaign Monitor fields. Name is the one field that takes several rows: they're joined with a space, in order, so first and last name fields make one name. A multiple-choice answer mapped to a "Pick many" field sends each ticked option. File uploads aren't offered. If the list uses confirmed opt-in, Campaign Monitor emails new subscribers and they stay Unconfirmed until they confirm.
Each row in the panel shows the action and its list. Use the switch to turn an action off without deleting it. With Forms' conditional logic, an action can run only when the answers match. The XPAC Agent can also connect a form to a list for you.
When a send fails
Sends run in the background a moment after the submission is saved, so the visitor never waits. Each one shows on XPAC → Forms → Deliveries:
| Status | What it means |
|---|---|
| Waiting | Queued, or waiting for its next automatic try. |
| Delivered | Campaign Monitor accepted it. The Notes column lists anything left out. |
| Skipped | There was nothing to send. The Error column says why. |
| Failed | It didn't go through. The Error column has Campaign Monitor's reason. |
| Dismissed | You dismissed it, or the submission is in spam or the trash. |
What Campaign Monitor outcomes look like:
- An empty email answer is Skipped. If another action in the same submission went through, the delivery is Delivered with a note instead.
- An address that is unsubscribed, bounced, suppressed, deleted or unconfirmed, with Re-add people who unsubscribed before off, is Delivered with a note such as Not added to "Newsletter": the address is unsubscribed in Campaign Monitor.
- Update existing subscriber or Unsubscribe for someone not on the list is Delivered with a note.
- An answer Campaign Monitor can't store (text in a Number field, a date before 1900 or after June 6, 2076, or a choice the field doesn't offer) is left out and named in a note.
- An address Campaign Monitor calls invalid is Failed and isn't retried.
A timeout, a rate limit or a server error is retried on its own after about 1, 5, 30 and 120 minutes, up to five tries. Other failures stay Failed until you act. Fix the cause, then click Retry now on the delivery, or Retry all failed. A retry sends with the form's current settings and the account saved now. Actions that already went through aren't sent again unless you've changed them since.
If 5 deliveries in a row fail on one form, XPAC pauses Campaign Monitor on that form and emails the site admin. An invalid address, an empty email answer and a rate limit don't count toward this. While it's paused, submissions are still saved but show as Failed, and XPAC tries one submission an hour. If that one goes through, sending starts again on its own. To start sooner, fix the cause and click Resume and retry on the Deliveries screen.
For developers
Register webhooks on the settings screen asks Campaign Monitor to post subscribe, update and deactivate events (unsubscribes, bounces and spam complaints) from every list of the client to this site. Nothing changes on the site unless code listens to these hooks:
| Hook | Type | When |
|---|---|---|
xpac_campaign_monitor_webhook_event | Action | Every event: $type, $email, $list, $event. |
xpac_campaign_monitor_subscribed | Action | A subscribe event: $email, $list, $event. |
xpac_campaign_monitor_deactivated | Action | An unsubscribe, bounce or spam complaint: $email, $list, $event. |
xpac_campaign_monitor_updated | Action | An update event: $email, $list, $event. |
xpac_campaign_monitor_values_dropped | Action | Answers were left out of an accepted subscriber: $dropped, $submission. |
xpac_campaign_monitor_request_timeout | Filter | Seconds to wait for Campaign Monitor. Default 10. |
xpac_campaign_monitor_optin_lookup_limit | Filter | How many lists are checked for confirmed opt-in. Default 25. |
xpac_campaign_monitor_check_options | Filter | Whether choice answers are checked against the field's options: $check, $list. Default true. |