Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Send welcome email even when there is no course password

  • Loading branch information...
commit fdce874a70411098b3b852e506516fba604b174a 1 parent 3db6b58
moodler authored
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;
Please sign in to comment.
Something went wrong with that request. Please try again.