Action
rpress_customer_post_set_primary_email
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#
| Parameter | Type | Description |
|---|---|---|
$new_primary_email | string | The email address being made primary. |
$customer_id | int | The customer ID. |
$customer | RPRESS_Customer | The 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), inRPRESS_Customer::set_primary_email()
See also#
Was this page helpful?
