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,manualandbackfillalso 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.
Related articles
- 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 |
