Skip to content
Docs
Get RestroPress

Action

rpress_update_customer_email_on_user_update

Updated
On this page

Fires after a customer's email is synced from an updated WordPress user.

Fires in RPRESS_DB_Customers::update_customer_email_on_user_update(), which runs on profile_update. It fires only when the user's email differs from the customer's, no other customer uses the new address, and the customer row was updated. The email stored on the customer's payments has been refreshed by then.

Parameters#

ParameterTypeDescription
$userWP_UserThe updated WordPress user.
$customerRPRESS_CustomerThe customer record linked to the user.

Example#

function my_update_customer_email( $user, $customer ) {
	error_log( 'Customer ' . $customer->id . ' email synced to ' . $user->user_email );
}
add_action( 'rpress_update_customer_email_on_user_update', 'my_update_customer_email', 10, 2 );

Source#

Fired from:

  • includes/class-rpress-db-customers.php (line 271), in RPRESS_DB_Customers::update_customer_email_on_user_update()
Was this page helpful?