Permalink
Browse files

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

…e support contact instead of admin
  • Loading branch information...
1 parent c7132d7 commit 6737eda4261fd5de66850a5337cf033698e4e795 @andyjdavis andyjdavis committed with danpoltawski Jun 26, 2012
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
@@ -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
@@ -709,7 +709,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
@@ -181,7 +181,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;
@@ -235,7 +236,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;
@@ -249,7 +250,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!");
}
}

0 comments on commit 6737eda

Please sign in to comment.