Enrolment plugin to notify users of account + password/teacher of self enrolment of user

Enrolment plugin to notify users of account + password/teacher of self enrolment of user

by Derek Chirnside -
Number of replies: 1

There is a tracker item for notifications to users of new accounts:

There are also items for teachers to get e-mails notifying them when a student self enrols.

There are forum posts here with code:

However, the problem is that these involve hacks to core code.

THREE QUESTIONS

1. How hard would it be to have a plugin that sends e-mails to users which have had new manual accounts created.  Maybe run once an hour.

2. How hard would it be to have a plugin that sneds an e-mail to teachers of courses when student self enrols in a course.

3. Ditto for e-mail to teachrs when a student FIRST visits a site.

ie no hacks of core.

-Derek

Average of ratings: -
In reply to Derek Chirnside

Re: Enrolment plugin to notify users of account + password/teacher of self enrolment of user

by Patrick Pollet -


Hello,

> ie no hacks of core.


The approach based on local events handling outlined here http://moodle.org/mod/forum/discuss.php?d=201499 does not require 'core hacks' . At least it will solve points 1 (event user_created) and 2 (event user_enrolled or role_assigned) . 

Point 3 may be solved by trapping event user_modified and checking that field fisrtaccess is equal to field lastaccess for the corresponding user. 

In all cases, your local handler will receive a record that you can use to further query the database, and ends with an eventual call to API function email_to_user(). See the sample codes proposed on github.  

Extra customizations (i.e. email address to sent to, subjects, ....) could be added as $CFG->xxxxx values directly added to config.php file (unsensible to future Moodle upgrades) or in tables mdl_config/mdl_config_plugins if you bother to write local settings.php scripts. 

Cheers.