Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-25476 messages: switched some notification emails to come from th…

…e support contact instead of admin
  • Loading branch information...
commit 95718caae7c13e6990e748053375d99e624c1d7f 1 parent 42ed541
@andyjdavis andyjdavis authored danpoltawski committed
Showing with 7 additions and 5 deletions.
  1. +1 −1  enrol/self/lib.php
  2. +1 −1  lib/cronlib.php
  3. +5 −3 user/edit.php
View
2  enrol/self/lib.php
@@ -291,7 +291,7 @@ protected function email_welcome_message($instance, $user) {
if ($rusers) {
$contact = reset($rusers);
} else {
- $contact = get_admin();
+ $contact = generate_email_supportuser();
}
//directly emailing welcome message rather than using messaging
View
2  lib/cronlib.php
@@ -700,7 +700,7 @@ function notify_login_failures() {
mtrace('Emailing admins about '. $count .' failed login attempts');
foreach ($recip as $admin) {
//emailing the admins directly rather than putting these through the messaging system
- email_to_user($admin,get_admin(), $subject, $body);
+ email_to_user($admin, generate_email_supportuser(), $subject, $body);
}
}
View
8 user/edit.php
@@ -169,7 +169,8 @@
$email_changed_html = '';
if ($CFG->emailchangeconfirmation) {
- // Handle change of email carefully for non-trusted users
+ // Users with 'moodle/user:update' can change their email address immediately
+ // Other users require a confirmation email
if (isset($usernew->email) and $user->email != $usernew->email && !has_capability('moodle/user:update', $systemcontext)) {
$a = new stdClass();
$a->newemail = $usernew->preference_newemail = $usernew->email;
@@ -223,7 +224,7 @@
// save custom profile fields data
profile_save_data($usernew);
- // If email was changed, send confirmation email now
+ // If email was changed and confirmation is required, send confirmation email now
if ($email_changed && $CFG->emailchangeconfirmation) {
$temp_user = fullclone($user);
$temp_user->email = $usernew->preference_newemail;
@@ -237,7 +238,8 @@
$emailupdatetitle = get_string('emailupdatetitle', 'auth', $a);
//email confirmation directly rather than using messaging so they will definitely get an email
- if (!$mail_results = email_to_user($temp_user, get_admin(), $emailupdatetitle, $emailupdatemessage)) {
+ $supportuser = generate_email_supportuser();
+ if (!$mail_results = email_to_user($temp_user, $supportuser, $emailupdatetitle, $emailupdatemessage)) {
die("could not send email!");
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.