]> git.mjollnir.org Git - moodle.git/commitdiff
Emails can take on course language as well
authormoodler <moodler>
Mon, 9 Feb 2004 08:49:54 +0000 (08:49 +0000)
committermoodler <moodler>
Mon, 9 Feb 2004 08:49:54 +0000 (08:49 +0000)
lib/moodlelib.php

index bdc2024a04e82be8cfa07d2bce921667da0cc9a9..7f9364b549c1c62a9f7f84217e4b6e9e07d91607 100644 (file)
@@ -1147,6 +1147,11 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a
 
     global $CFG, $_SERVER;
 
+    global $course;                // This is a bit of an ugly hack to be gotten rid of later
+    if (!empty($course->lang)) {   // Course language is defined
+        $CFG->courselang = $course->lang;
+    }
+
     include_once("$CFG->libdir/phpmailer/class.phpmailer.php");
 
     if (!$user) {