End Of Enrolment check and email in 2.x

End Of Enrolment check and email in 2.x

by Anne Krijger -
Number of replies: 4

I am told there used to be an option in < 2.x where users could automatically be notificated oft their eiunde enrolmetn in a course.

I've looked at the 2.x code but don't seen anything that would suggest that feature exists.

Am I looking in the wrong direction, did it used to be there and now is gone?

And if not present, what would be the best way to implement?
I would guess by checking the entdtime in user_enrolments as part of the cron job(s).

Anne.

Average of ratings: -
In reply to Anne Krijger

Re: End Of Enrolment check and email in 2.x

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Your typing got a bit unclear at one point - are you looking for email notifications when users are first enroled on a course, when they are in danger of being automatically unenrolled from a course or when they are actually unenrolled from a course?

Whichever case it is, this is something that is controlled from within the individual enrolment plugins.

As with Moodle 1.9 (unless I am mistaken) the 'welcome to this course' message is only sent out by 'self enrolment' (M2.x: enrol/self/lib.php). 

If you are looking for unenrolment-related messages, I don't think they are sent. If you are using a custom enrolment type, then you could easily add them there. Alternatively, you could clone the code for one of the standard enrolment plugins and add it there. Finally, you could do as you suggested and do some checking of endtimes via cron (in a local plugin?).

In reply to Davo Smith

Re: End Of Enrolment check and email in 2.x

by Anne Krijger -

Hi Davo,

Sorry, I didn't get a chance to fix my typoos after posting, so I'll give it another try.

What I am looking for is functionality where a user will be send an email when their enrolment is about to end.

So assume I've set the enrolment of user D. to end on the 15th of April 2012, I'd like him to receive an email on the 13th of April warning him that he only has two days left.

I was told there was functionality like this in 1.9, but I haven't seen it in 2.x.

If it is not available I'll set up a cron job which does this.
I will be adding cron jobs anyway, so one more won't matter much, but I'd rather not create functionality that already exists.

Anne.
[spell checks and clicks post]

In reply to Anne Krijger

Re: End Of Enrolment check and email in 2.x

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

@Anne I'm fairly certain that this functionality does not exist in Moodle 1.9 or Moodle 2.x (I was asked to implement something very similar to this in both Moodle versions for a particular client).

It's a reasonably straight-forward SQL query (but I can't copy & paste my version here, as that was built into a specific course enrolment type and included both site and course settings for unenrolment threshold and unenrolment notification threshold, so it is far more complicated than you need).

Average of ratings: Useful (1)
In reply to Davo Smith

Re: End Of Enrolment check and email in 2.x

by Anne Krijger -

Hi Dave,

Thanks.
All i needed to know if it exists or not.
I don't think I'll have a problem writing the cutom code for it.
I just don't like to replicate code/functionality just because I don't know it exists smile

Anne.