I was hoping someone could help me. I am trying to send an email to each teacher of a course that they are member of when a user completes a scorm course. I have added this code int the locallib.php and it sends an email but I don't know how to get it to send to the courses teachers instead of just a hard coded email. Can anyone give a bit of assistance?
// EMAIL TEACHER ON COMPLETE
if ($track->value == 'completed') {
// the message
$msg = format_string($USER->firstname) . " " . format_string($USER->lastname) . " has Completed " . format_string($scorm->name);
// use wordwrap() if lines are longer than 70 characters
$msg = wordwrap($msg,70);
// send email
mail("email@gmail.com","AccessCare Module Completion",$msg,"From: AccessCareResources");
}
//EMAIL TEACHER END
Thanks in advance!