Details
Description
As the site admin, I would like to receive an email to notify me that a course has been requested so I know to look at the pending requests.
Ours is a small site, and I do not routinely go to the course creation page where I would see the message that a request was made.
The email does not need to include any details - a simple statement that a request has been made, so I know that I should deal with it.
This is the code I added to /admin/cron.php, just after the language cache is checked (so the course request check will be done every time the cron job is run). I've hard-coded the strings, so you might want to change it a bit and add it to a language file:
mtrace("Checking course creation requests");
if ($pending = get_records("course_request")) { $admin = get_admin(); $subject = "Course requests pending approval"; $messagetext = "Course requests have been submitted for approval. Please check pending.html."; email_to_user($admin,$admin,$subject,$messagetext); }
mtrace("Course requests checked");