Hook: mam_brevo_sync_user

Signature

do_action( 'mam_brevo_sync_user', int $user_id, string $context );
Parameter Type Description
$user_id int The WordPress user to update.
$context string A short reason, for example plan_change. Passed to mam_brevo_should_sync_user and shown in the log.

Behaviour

  • Fire it from your code; MAM Brevo Email Manager listens for it. If the plugin is not active, nothing happens, so it is safe to fire unconditionally.
  • It only queues a background job. Your code does not wait for Brevo.
  • Several calls for the same user before the job runs become one Brevo update, built from the user’s data at the time the job runs.
  • Nothing is queued while Sync active is off.
  • With most contexts it only updates users who are already in Brevo (synced, queued or failed before). The contexts signup, manual and backfill also add users who are not in Brevo yet.
  • If nothing changed since the last sync, no call is made to Brevo.

Example

Update Brevo when a subscription plan changes:

add_action( 'my_plugin_plan_changed', function ( $user_id ) {
    do_action( 'mam_brevo_sync_user', $user_id, 'plan_change' );
} );

The new plan reaches Brevo through your mam_brevo_contact_attributes filter.


  • Hook: mam_brevo_contact_attributes
  • Hook: mam_brevo_user_synced

Metadata

Field Value
Article type Hook Reference
Plugin slug mam-brevo-email-manager
Applies to plugin version 26.41.1+
Category Extending MAM Suite
Hook type action
Audience PHP developer
Last verified 2026-10-05
Was this article helpful?
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!