From 19c8cf79171733850bfc8392d74f5cfaddef1e6d Mon Sep 17 00:00:00 2001 From: mchurch Date: Fri, 28 Dec 2007 17:14:01 +0000 Subject: [PATCH] MDL-12703 - Use the 'welcometocourse' language string if there is no 'welcomemessage' property set in the course object. Currently, there does not seem to be any code or data items that would set this property. --- lib/moodlelib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 0179378adc..39db18df22 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -4283,13 +4283,18 @@ function email_welcome_message_to_user($course, $user=NULL) { } if (!empty($course->welcomemessage)) { - $subject = get_string('welcometocourse', '', format_string($course->fullname)); - + $message = $course->welcomemessage; + } else { + $a = new Object(); $a->coursename = $course->fullname; $a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id"; - //$message = get_string("welcometocoursetext", "", $a); - $message = $course->welcomemessage; + $message = get_string("welcometocoursetext", "", $a); + } + /// If you don't want a welcome message sent, then make the message string blank. + if (!empty($message)) { + $subject = get_string('welcometocourse', '', format_string($course->fullname)); + if (! $teacher = get_teacher($course->id)) { $teacher = get_admin(); } -- 2.39.5