Best practice forum (Archived)

Course reminders not sending out emails - Also not on 2.5

 
Billy Morrison
Course reminders not sending out emails - Also not on 2.5
by Billy Morrison - Tuesday, 11 February 2014, 9:55 AM
 

Hello Everyone, 

I hope you are all well. 

I have setup some course Feedback reminders on Totara 2.2.16 and the distribution of these is linked to the completion of another course activity. When users complete the activity and the cron is kicked it states that it doesn't have anyone to send the reminder to. 

The cron is seeing the feedback reminders but just gives the following error: 

Processing reminder "test reminder" for course "reminder test" (507)
WARNING: no users to send reminder message to (message id 22)... SKIPPING
WARNING: no users to send reminder message to (message id 23)... SKIPPING
WARNING: no users to send reminder message to (message id 24)... SKIPPING

No email is then generated. Has anyone encountered this before or had any issues with the course reminder functionality?

I have also looked at the course reminders on Totara 2.5 and they don't seem to be present, have they been removed?

Any help or advice on the queries raised would be greatly appreciated,

Cheers

Billy

Billy Morrison
Re: Course reminders not sending out emails - Also not on 2.5
by Billy Morrison - Tuesday, 11 February 2014, 10:58 AM
 

Just an update on this through testing;

The reminder email is generated off the back of overall course completion but doesn't send off the activity completion. Therefore the functionality is half working :)

Any ideas why it won't generate off the activities?

And, like above has this functionality been removed from 2.5?

Cheers

Billy

Ciaran Irvine (Core Developer)
Re: Course reminders not sending out emails - Also not on 2.5
by Ciaran Irvine (Core Developer) - Tuesday, 11 February 2014, 3:31 PM
 

Hey Billy,

Well spotted, the links to course competencies and course reminders went AWOL in 2.5 after a recent Moodle merge, so that should be fixed in the next 2.5 release next Tuesday.

I'll investigate the activity reminder issue further and get back to you on that one.

Billy Morrison
Re: Course reminders not sending out emails - Also not on 2.5
by Billy Morrison - Wednesday, 12 February 2014, 2:43 AM
 

Thanks very much for the update Ciaran!

Looking forward to your update on the activity completion reliance. 

Cheers

Billy

Ciaran Irvine (Core Developer)
Re: Course reminders not sending out emails - Also not on 2.5
by Ciaran Irvine (Core Developer) - Monday, 17 February 2014, 8:30 PM
 

A fix for the missing links issue was included in today's (18th Feb 2014) release of Totara 2.5.8

Ciaran Irvine (Core Developer)
Re: Course reminders not sending out emails - Also not on 2.5
by Ciaran Irvine (Core Developer) - Thursday, 13 February 2014, 5:47 PM
 

Hi Billy,

I did get this working but it was a bit convoluted.

First I assigned an activity completion criteria to a random activity, in this case an assignment where the user had to receive a grade.

Then I added a Feedback, restricted the access until the Assignment was complete, and then added the Reminders.

And THEN I set up course completion criteria where the course could not be completed until the Assignment activity was marked as complete. This is because the code in lib/reminderlib.php reminder_cron actually checks tables course_completion_criteria and course_completion_crit_compl so reminders always have to run off of course completion criteria, not individual activity completions...but of course you also need the activity completions to set up the internal workflow of the course.

But then there is one more little issue - if the cron runs quickly then the course completion criteria for the activity will get marked as complete in course_completion_crit_compl...but the timestamp difference in the SQL (lib/reminderlib.php lines 486 and 487) *might* not trigger if it gets to reminder_cron in the exact same second...which means the reminder will be sent out on the *next* (2nd) cron run...as long as the cron is running more than once a day.

Maybe the sql on line 487 should be AND (cc.timecompleted + ?) <= ? to avoid this

This was in 2.5, with the fix for the missing Reminders link that is pending release - you should be able to still access reminders in 2.5 by manually going to /course/reminders.php?courseid=xx. I'm not sure if 2.2 works though, the completion code has changed a lot since 2.2. But you can give it a go and let me know.