Skip to content
Docs
Get RestroPress

Action

rpress_post_add_customer_email

Updated
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#

ParameterTypeDescription
$customer_idintThe customer ID.
$argsarrayThe 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), in rpress_add_customer_email()
Was this page helpful?