diff --git a/includes/emails/class.llms.email.reset.password.php b/includes/emails/class.llms.email.reset.password.php index 390277ab7e..661b3c7c5d 100644 --- a/includes/emails/class.llms.email.reset.password.php +++ b/includes/emails/class.llms.email.reset.password.php @@ -32,10 +32,20 @@ public function init( $args = array() ) { $this->add_recipient( $args['user']->ID ); + $original_locale = get_locale(); + $locale = get_user_locale( $args['user']->ID ); + if ( $locale && $locale !== $original_locale ) { + switch_to_locale( $locale ); + } + $this->body = $this->get_body_content( $args ); $this->subject = __( 'Password Reset for {site_title}', 'lifterlms' ); $this->heading = __( 'Reset Your Password', 'lifterlms' ); + if ( $locale && $locale !== $original_locale ) { + restore_previous_locale(); + } + $this->add_merge_data( array( '{user_login}' => $args['login_display'], @@ -47,9 +57,7 @@ public function init( $args = array() ) { * Custom content for the password reset email * * @param array $data associative array of user related data for the email to be sent - * @return void * @since 3.8.0 - * @version 3.8.0 */ public function get_body_content( $data ) {