WC_Email_Customer_New_Account::trigger( int $user_id, string $user_pass = '', bool $password_generated = false )
Trigger.
Description Description
Parameters Parameters
- $user_id
-
(Required) User ID.
- $user_pass
-
(Optional) User password.
Default value: ''
- $password_generated
-
(Optional) Whether the password was generated automatically or not.
Default value: false
Source Source
File: includes/emails/class-wc-email-customer-new-account.php
public function trigger( $user_id, $user_pass = '', $password_generated = false ) {
$this->setup_locale();
if ( $user_id ) {
$this->object = new WP_User( $user_id );
$this->user_pass = $user_pass;
$this->user_login = stripslashes( $this->object->user_login );
$this->user_email = stripslashes( $this->object->user_email );
$this->recipient = $this->user_email;
$this->password_generated = $password_generated;
}
if ( $this->is_enabled() && $this->get_recipient() ) {
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
}
$this->restore_locale();
}