From: defacer Date: Sat, 5 Feb 2005 01:36:55 +0000 (+0000) Subject: Enforcing the "email type" (text/HTML) user setting at core library level. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=756e18236269a4598aa1364e5d40baeba6ccce7d;p=moodle.git Enforcing the "email type" (text/HTML) user setting at core library level. With well-written client code this should not be needed, but after getting burned once I think it's a good idea to make it "smart". --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index e4db18284f..e80daecdcb 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2717,7 +2717,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $a } } - if ($messagehtml) { + if ($messagehtml && $user->mailformat == 1) { // Don't ever send HTML to users who don't want it $mail->IsHTML(true); $mail->Encoding = 'quoted-printable'; // Encoding to use $mail->Body = $messagehtml;