]> git.mjollnir.org Git - moodle.git/commitdiff
Enforcing the "email type" (text/HTML) user setting at core library level.
authordefacer <defacer>
Sat, 5 Feb 2005 01:36:55 +0000 (01:36 +0000)
committerdefacer <defacer>
Sat, 5 Feb 2005 01:36:55 +0000 (01:36 +0000)
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".

lib/moodlelib.php

index e4db18284fab53a28c88d8f0f620bf3915b52679..e80daecdcb71cb575b2c5ea25a3dfd1ecfc1e8ee 100644 (file)
@@ -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;