Skip to content
Docs
Get RestroPress

Action

rpress_customer_post_set_primary_email

Updated
On this page

Fires after an email is set as the customer's primary email.

Fires at the end of RPRESS_Customer::set_primary_email(), after the customer record and the email meta have been updated, and after the email stored on the customer's payments has been refreshed. It does not fire on the early-return paths.

Parameters#

ParameterTypeDescription
$new_primary_emailstringThe email address being made primary.
$customer_idintThe customer ID.
$customerRPRESS_CustomerThe customer object.

Example#

function my_customer_post_set_primary_email( $new_primary_email, $customer_id, $customer ) {
	update_user_meta( (int) $customer->user_id, 'my_primary_email', $new_primary_email );
}
add_action( 'rpress_customer_post_set_primary_email', 'my_customer_post_set_primary_email', 10, 3 );

Source#

Fired from:

  • includes/class-rpress-customer.php (line 322), in RPRESS_Customer::set_primary_email()

See also#

Was this page helpful?