Manual Enrolment Expiration Emails

Manual Enrolment Expiration Emails

by S D F -
Number of replies: 1

Hi all,

I have searched for this on the forums but besides seeing people suggesting an edit to moodle core  (which I do not want to do), or the suggestion to use a plugin  (I also would prefer not to do this), the question as not been fully answered.

The issue:

When selecting Enroller and Enrolled User from "enrol_manual | expirynotify", no email is sent to the "enrolled user".
As the enroller I receive the emails telling me which users are due to expire on the course(s).
(Albeit this is quite annoyingly hard to test due to the script firing once per hour it seems).

Version: 3.9.2, The issue was also in our 3.6.2 installation which I upgraded to see if the issue would resolve. We have no enrolment plugins beside those included in moodle. 

Environment is PHP 7.4.11, Centos 7. Mysql 5.7. Every recommendation is matched or exceeded.

What I have tried

I have tested the users in question can receive emails by performing password resets and also using the email test facility under: 
Site administration -> Server -> Email -> Outgoing mail configuration. Which both work successfully.

I have also checked: Site administration -> Messaging -> Notification settings for the setting: Manual enrolment expiry notifications
All options are permitted (email / notification) and the option is also enabled.

I have also checked on the individual user account, Dashboard -> Preferences -> User account -> Notification preferences, that the notifications are not disabled here. Also that the checkbox at the top of this page is unchecked (disallow notifications).

I have full access to the server, so I am able to monitor mail logs etc, which I have done to confirm that only the email to the "enroller" is being sent, and not the enrolled user. It is not the mail configuration. 

Is there something else I should check that might block this?


Edit: 

  • Cron is running via crontab every minute, there are no errors
  • I've purged every cache for the sake of it
  • Checking logs on moodle, I can only see the notification sent to user "2" which is myself, and not the user themselves.
    Using the filters: Sources - CLI and Events: Other
  • The scheduled tasks:  Manual enrolment send expiry notifications task and Synchronise manual enrolments task are enabled. All scheduled tasks are set to default.
Average of ratings: -
In reply to S D F

Re: Manual Enrolment Expiration Emails

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

PhpUnit tests show that the function normally works.  Recent results can be seen here.

Perhaps you have an old plugin using a wrong namespace or that is incompatible with php7.4?  A good place to search is the overview of scheduled tasks (admin/tool/task/scheduledtasks.php).  Find your task that has never run and that is not disabled. Enable debugging and try to run the task manually.