danmarsden / moodle-local_recompletion

Allows course recompletion
29 stars 46 forks source link

Send recompletion message from an email different than the primary site admin #190

Open abias opened 3 months ago

abias commented 3 months ago

This issue might overlap with #23, but it goes beyond it:

One of our customers was wondering why the local_recompletion messages are coming from the primary admin - and I was wondering as well.

Looking at https://github.com/danmarsden/moodle-local_recompletion/blob/bb0a804c120921b4bad345c06e27e086de2df17c/classes/task/check_recompletion.php#L207, I see that the messages are really sent by the primary admin which does not really make sense in our hosted environments where the primary admin is always a special support user. But in other scenarios, it might not make sense as well as a student won't necessarily know the name of the Moodle admins.

Talking to Dan privately, we found two feasible improvement approaches:

The larger one: The teacher configuring the course recompletion would be able to select the sender from the list of course contacts (as defined by $CFG->coursecontact). If the selected sender is unenrolled or if the teacher does not select anyone at all, the fallback will be support email. And if this is not set, it will default back to the admin email.

The smaller one: A global plugin setting which would allow the admin to set the sender for all activity instances and courses. This setting would offer these options: • Primary admin (default and current behaviour) • Moodle Support user • Moodle Noreply user

Unfortunately, we did not receive funding for this implementation up to now, but I document the discussion result here anyway to allow other community members to step forward and craft a PR.

Cheers, Alex

danmarsden commented 3 months ago

Thanks for adding it here Alex!