My organiztion is using moodle to support some if its traditional standup training. When a student registers for a classes a supervisor needs to be notified. That being said, I am trying to create an automatic notification e-mail that gets sent when a student enrolls in a class. It should be said at this point that I am a relative newbie to PHP but I understand the major principals and codes
I have already created a field in the user_table for the superviosrs e-mail address. I was also able to create strings for the supemail, supname , supsubject and content in the moodle.php file.
I used the e-mail code from the changepassword.php file as a template and changed the string names.I have added the following lines of code to the enrol.php file after the enrollment key is found to be true.
email_to_user($supemail, $subject, $message)
$a->email = get_string("supemail"),
$subject = get_string("emailsupsuject"),
$contents = get_string ("emailenrolltosup"),
$from_header = get_string ("email");
I am currently recieving a Parse Error, unexpected 'T_VARIABLE' line 46 which is the 2nd line of code above.
Any thoughts as how this could be done or what the problem might be would be greatly appreciated!