WC_Email_Customer_New_Account::trigger
Trigger.
Method of the class: WC_Email_Customer_New_Account{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Email_Customer_New_Account = new WC_Email_Customer_New_Account(); $WC_Email_Customer_New_Account->trigger( $user_id, $user_pass, $password_generated );
- $user_id(int) (required)
- User ID.
- $user_pass(string)
- User password.
Default:'' - $password_generated(true|false)
- Whether the password was generated automatically or not.
Default:false
WC_Email_Customer_New_Account::trigger() WC Email Customer New Account::trigger code WC 10.9.1
public function trigger( $user_id, $user_pass = '', $password_generated = false ) {
$this->setup_locale();
if ( $user_id ) {
$this->object = new WP_User( $user_id );
$this->set_password_url = $this->generate_set_password_url();
$this->user_login = stripslashes( $this->object->user_login );
$this->user_email = stripslashes( $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->user_login;
$this->recipient = $this->user_email;
$this->user_pass = $user_pass;
$this->password_generated = $password_generated;
}
$this->send_notification();
$this->restore_locale();
}