Action
rpress_post_add_customer_email
On this page
Fires after an email address is added to a customer from the admin.
Runs at the end of rpress_add_customer_email() after the email has been processed and, if requested, set as primary. It fires before the JSON response is returned for AJAX requests or the redirect for others. Use it to sync the new address with an external system.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$customer_id | int | The customer ID. |
$args | array | The request arguments, including the submitted email, customer ID and nonce. |
Example#
function my_sync_customer_email( $customer_id, $args ) {
do_action( 'my_crm_resync_customer', (int) $customer_id );
}
add_action( 'rpress_post_add_customer_email', 'my_sync_customer_email', 10, 2 );
Notes#
Fires on every call, including when validation failed or the email was already in use, so inspect the customer if the outcome matters. $customer_id may then be unset or empty.
Source#
Fired from:
includes/admin/customers/customer-actions.php(line 204), inrpress_add_customer_email()
Was this page helpful?
