(cp bb8f3d571) fixes #2287 switch language before sending the email

This commit is contained in:
Linty
2024-12-04 15:11:32 +01:00
parent bc46d69ff7
commit cafdd0b6ac
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -1023,7 +1023,9 @@ function ws_users_generate_password_link($params, &$service)
$first_login = has_already_logged_in($params['user_id']);
$generate_link = generate_password_link($params['user_id'], $first_login);
$send_by_mail_response = null;
$lang_to_use = $first_login ? get_default_language() : $user_lost['language'];
switch_lang_to($lang_to_use);
if ($params['send_by_mail'] and !empty($user_lost['email']))
{
if ($first_login)
@@ -1044,6 +1046,7 @@ function ws_users_generate_password_link($params, &$service)
$send_by_mail_response = false;
}
}
switch_lang_back();
return array(
'generated_link' => $generate_link['password_link'],