Permalink
Browse files

Send welcome email even when there is no course password

  • Loading branch information...
1 parent 3db6b58 commit fdce874a70411098b3b852e506516fba604b174a moodler committed Oct 7, 2004
Showing with 10 additions and 0 deletions.
  1. +10 −0 enrol/enrol.class.php
View
10 enrol/enrol.class.php
@@ -148,6 +148,16 @@ function print_entry($course) {
if (! enrol_student($USER->id, $course->id, $timestart, $timeend)) {
error("An error occurred while trying to enrol you.");
}
+
+ $subject = get_string("welcometocourse", "", $course->fullname);
+ $a->coursename = $course->fullname;
+ $a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id";
+ $message = get_string("welcometocoursetext", "", $a);
+ if (! $teacher = get_teacher($course->id)) {
+ $teacher = get_admin();
+ }
+ email_to_user($USER, $teacher, $subject, $message);
+
add_to_log($course->id, "course", "enrol", "view.php?id=$course->id", "$USER->id");
$USER->student[$course->id] = true;

0 comments on commit fdce874

Please sign in to comment.