Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.4.1, 3.7
-
MOODLE_34_STABLE, MOODLE_37_STABLE
-
MOODLE_38_STABLE
-
MDL-61649-master -
-
1
-
Moppies Moodle 3.8 Sprint 1, Moppies Moodle 3.8 Sprint 2, Moppies Moodle 3.8 Sprint 3, Moppies Moodle 3.8 Sprint 4
Description
Some core emails (see list below) only provide the email_to_user function with a text format message rather than providing the (currently optional) HTML message as well.
This has two drawbacks:
1) Users who opt to receive HTML emails, will sometimes (with no obvious pattern) recieve text emails from their Moodle site which might make them wonder if their settings are correct and/or if these messages are really coming from their Moodle. Many of these messages are around authentication, so that confidence is probably important.
2) Sites that use the new email wrapping mustache templates core/html_email.mustache will have these text only emails automatically converted to HTML, which works fine for text only content, but anything with a link in it will no longer be clickable, just displayed as text.
$autohtml = trim(text_to_html($messagetext));
Possible areas to improve:
lib/authlib.php
781=function login_lock_account($user) {
822: email_to_user($user, $supportuser, $subject, $message);
lib/classes/task/send_failed_login_notifications_task.php
29=class send_failed_login_notifications_task extends scheduled_task {
177: email_to_user($admin, \core_user::get_noreply_user(), $subject, $body);
lib/moodlelib.php
6100=function setnew_password_and_mail($user, $fasthash = false) {
6129: return email_to_user($user, $supportuser, $subject, $message);
6139=function reset_password_and_mail($user) {
6173: return email_to_user($user, $supportuser, $subject, $message);
6232=function send_password_change_confirmation_email($user, $resetrecord) {
6252: return email_to_user($user, $supportuser, $subject, $message);
6262=function send_password_change_info($user) {
6282: return email_to_user($user, $supportuser, $subject, $message);
6303: return email_to_user($user, $supportuser, $subject, $message);
user/edit.php
273: if (!$mailresults = email_to_user($tempuser, $noreplyuser, $emailupdatetitle, $emailupdatemessage)) {
Possibly it's worth considering making the HTML format non-optional.