diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 23ba98ef8dd..ee0f7bd64bb 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -218,7 +218,7 @@ function cc_submit($form, $course) $teacher = get_teacher($course->id); if (!empty($CFG->enrol_mailstudents)) { $a->coursename = "$course->fullname"; - $a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id"; + $a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id"; email_to_user($USER, $teacher, get_string("enrolmentnew", '', $course->shortname), get_string('welcometocoursetext', '', $a)); }