diff --git a/message/edit.php b/message/edit.php index 762bd5b7e43..ca66db93562 100644 --- a/message/edit.php +++ b/message/edit.php @@ -144,7 +144,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { $preferences['message_blocknoncontacts'] = !empty($form->blocknoncontacts)?1:0; //$preferences['message_beepnewmessage'] = !empty($form->beepnewmessage)?1:0; -/// Save all the new preferences to the database + // Save all the new preferences to the database if (!set_user_preferences( $preferences, $user->id ) ){ print_error('cannotupdateusermsgpref'); } @@ -154,6 +154,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { /// Load preferences $preferences = new stdClass(); +$preferences->userdefaultemail = $user->email;//may be displayed by the email processor /// Get providers preferences $providers = message_get_my_providers(); @@ -204,8 +205,8 @@ if ($course->id != SITEID) { } echo $OUTPUT->header(); -/// Start the form. We're not using mform here because of our special formatting needs ... -echo '
'; +// Start the form. We're not using mform here because of our special formatting needs ... +echo ''; /// Settings table... echo '
'; diff --git a/message/output/email/message_output_email.php b/message/output/email/message_output_email.php index d98c311658d..0bd91655ea8 100644 --- a/message/output/email/message_output_email.php +++ b/message/output/email/message_output_email.php @@ -67,7 +67,13 @@ class message_output_email extends message_output { global $USER; $string = get_string('email','message_email').': '; if (empty($preferences->email_email)) { - $string .= ' ('.get_string('default').': '.$USER->email.')'; + $userdefaultemail = null; + if (empty($preferences->userdefaultemail)) { + $userdefaultemail = $USER->email; + } else { + $userdefaultemail = $preferences->userdefaultemail; + } + $string .= ' ('.get_string('default').': '.$userdefaultemail.')'; } return $string; }