Hooks

Mailchimp

8 hooks fired by Mailchimp: 5 filters and 3 actions across 8 call sites.

8 hooks fired by Mailchimp: 5 filters and 3 actions across 8 call sites. 8 of the 8 call sites are described by a docblock, at the call or on the constant that names the hook; the rest are listed with their signature and call sites only. Paths are relative to the plugin directory.

xpac-forms-after-settings-modal-content

Filter · 3 arguments · 1 call site

Content appended inside a settings panel's item modal.

applyFilters( 'xpac-forms-after-settings-modal-content', [], { value: options, onChange: onUpdate, }, `xpac-${ID}` )

Fired from:

  • assets/packages/mailchimp/Components/Modal.js:364

xpac_forms_mailchimp_contact_email_changed

Action · 3 arguments · 1 call site

Fires when a contact changes the address Mailchimp holds for them.

do_action( 'xpac_forms_mailchimp_contact_email_changed', (string) self::asString($data['old_email'] ?? ''), (string) self::asString($data['new_email'] ?? ''), $data )
  • $old (string) — Address Mailchimp held before.
  • $new (string) — Address it holds now.
  • $data (array) — The event's data block.

Fired from:

  • packages/Mailchimp/Addon.php:1993

xpac_forms_mailchimp_contact_opted_out

Action · 3 arguments · 1 call site

Fires when Mailchimp reports a contact as no longer mailable.

unsubscribe is the contact's own choice and cleaned is an address Mailchimp has given up on; both mean the same thing to a site deciding whether to write to somebody.

do_action( 'xpac_forms_mailchimp_contact_opted_out', $email, $type, $data )
  • $email (string) — Address that is no longer mailable.
  • $type (string) — Which of the two it was.
  • $data (array) — The event's data block.

Fired from:

  • packages/Mailchimp/Addon.php:1982

xpac_forms_mailchimp_webhook

Action · 3 arguments · 1 call site

Fires for a Mailchimp callback carrying this site's own secret.

do_action( 'xpac_forms_mailchimp_webhook', $type, $data, $email )
  • $type (string) — Event type: unsubscribe, cleaned, profile or upemail.
  • $data (array) — The event's data block, exactly as Mailchimp posted it.
  • $email (string) — Address the event is about, where it named one.

Fired from:

  • packages/Mailchimp/Addon.php:1968

xpac_mailchimp_permission_sample

Filter · 2 arguments · 1 call site

Filters how many contacts are read when looking for an audience's marketing permissions.

They are all read in one request, so a larger sample costs response size rather than calls. 1 restores the behaviour of the releases that read a single contact.

apply_filters( 'xpac_mailchimp_permission_sample', self::PERMISSION_SAMPLE, $list )
  • $sample (int) — Contacts to read. Default 100.
  • $list (string) — List the permissions are being read from.

Fired from:

  • packages/Mailchimp/Client.php:571

xpac_mailchimp_report_dropped_fields

Filter · 2 arguments · 1 call site

Filters whether a delivery checks the merge fields Mailchimp kept.

The check reads the answer the upsert already gave, so turning it off saves nothing but the note on the delivery. It exists for a site that would rather not be told an answer is being thrown away, and for one whose audience answers in a shape this cannot read.

apply_filters( 'xpac_mailchimp_report_dropped_fields', true, $list )
  • $reports (bool) — Whether to report dropped merge fields. Default true.
  • $list (string) — List the contact was written to.

Fired from:

  • packages/Mailchimp/Addon.php:1080

xpac_mailchimp_request_timeout

Filter · 1 argument · 1 call site

Filters how long, in seconds, to wait for Mailchimp to reply.

The request no longer runs inside the visitor's submission, so this is a tolerance for a slow API rather than a latency budget: nothing is waiting on it, and a timeout shorter than Mailchimp's own response time turns a contact that was accepted into a needless retry.

apply_filters( 'xpac_mailchimp_request_timeout', 10 )
  • $timeout (int) — Seconds to wait. Default 10.

Fired from:

  • packages/Mailchimp/Client.php:112

xpac_mailchimp_webhook_registration

Filter · 2 arguments · 1 call site

Filters the callback registration sent to Mailchimp for one audience.

apply_filters( 'xpac_mailchimp_webhook_registration', [ 'url' => $url, 'events' => [ 'subscribe' => false, 'unsubscribe' => true, 'profile' => true, 'upemail' => true, 'cleaned' => true, 'campaign' => false, ], 'sources' => [ 'user' => true, 'admin' => true, 'api' => false, ], ], $list )
  • $registration (array) — Body for POST or PATCH /lists/{id}/webhooks.
  • $list (string) — List the callback belongs to.

Fired from:

  • packages/Mailchimp/Addon.php:1669

On this page