mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-31092 send localised new account emails
This commit is contained in:
parent
60e99097e4
commit
5e1e0d7fe5
1 changed files with 7 additions and 2 deletions
|
@ -5238,6 +5238,11 @@ function generate_email_supportuser() {
|
|||
function setnew_password_and_mail($user) {
|
||||
global $CFG, $DB;
|
||||
|
||||
// we try to send the mail in language the user understands,
|
||||
// unfortunately the filter_string() does not support alternative langs yet
|
||||
// so multilang will not work properly for site->fullname
|
||||
$lang = empty($user->lang) ? $CFG->lang : $user->lang;
|
||||
|
||||
$site = get_site();
|
||||
|
||||
$supportuser = generate_email_supportuser();
|
||||
|
@ -5254,9 +5259,9 @@ function setnew_password_and_mail($user) {
|
|||
$a->link = $CFG->wwwroot .'/login/';
|
||||
$a->signoff = generate_email_signoff();
|
||||
|
||||
$message = get_string('newusernewpasswordtext', '', $a);
|
||||
$message = (string)new lang_string('newusernewpasswordtext', '', $a, $lang);
|
||||
|
||||
$subject = format_string($site->fullname) .': '. get_string('newusernewpasswordsubj');
|
||||
$subject = format_string($site->fullname) .': '. (string)new lang_string('newusernewpasswordsubj', '', $a, $lang);
|
||||
|
||||
//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
|
||||
return email_to_user($user, $supportuser, $subject, $message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue