Automattic\WooCommerce\Internal\CustomerEmailVerification\Emails
CustomerVerifyEmail::trigger
Trigger the sending of this email.
Method of the class: CustomerVerifyEmail{}
No Hooks.
Returns
void. Nothing (null).
Usage
$CustomerVerifyEmail = new CustomerVerifyEmail(); $CustomerVerifyEmail->trigger( $user_id, $verify_url );
- $user_id(int) (required)
- The user ID to send the email to.
- $verify_url(string)
- The one-time verification URL.
Default:''
CustomerVerifyEmail::trigger() CustomerVerifyEmail::trigger code WC 11.1.2
public function trigger( $user_id, $verify_url = '' ) {
$this->setup_locale();
if ( $user_id && $verify_url ) {
$this->object = new WP_User( $user_id );
$this->verify_url = $verify_url;
$this->recipient = wp_unslash( $this->object->user_email );
$customer = new WC_Customer( $user_id );
$first_name = ! empty( $customer->get_billing_first_name() ) ? $customer->get_billing_first_name() : $this->object->first_name;
$this->user_display_name = ! empty( $first_name ) ? $first_name : $this->object->user_login;
$this->send_notification();
}
$this->restore_locale();
}