Skip to content

Commit f61c394

Browse files
author
Kristan Kenney
authored
Merge pull request hestiacp#1713 from jaapmarcus/fix/translate-emails-send
Fix/translate emails send
2 parents e07608d + 85bd52c commit f61c394

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

web/add/user/index.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,23 @@
8888
// Send email to the new user
8989
if ((empty($_SESSION['error_msg'])) && (!empty($v_notify))) {
9090
$to = $_POST['v_notify'];
91-
$subject = _("Welcome to Hestia Control Panel"); //currently not supported to use the account language
91+
// send email in "users" language
92+
putenv("LANGUAGE=".$_POST['v_language']);
93+
94+
$subject = _("Welcome to Hestia Control Panel");
9295
$hostname = exec('hostname');
9396
unset($output);
94-
$from = sprintf(_('MAIL_FROM'),$hostname); //currently not supported to use the account language
97+
$from = sprintf(_('MAIL_FROM'),$hostname);
9598

9699
if (!empty($_POST['v_name'])) {
97100
$mailtext = sprintf(_('GREETINGS_GORDON'),$_POST['v_name'])."\r\n";
98101
} else {
99102
$mailtext = _('GREETINGS')."\r\n";
100103
}
104+
101105
$mailtext .= sprintf(_('ACCOUNT_READY'),$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']);
102106
send_email($to, $subject, $mailtext, $from);
107+
putenv("LANGUAGE=".detect_user_language());
103108
}
104109

105110
// Flush field values on success

0 commit comments

Comments
 (0)