Totara Learn Open Discussions

Course due date notification

 
Christina Stoll
Course due date notification
by Christina Stoll - Tuesday, 9 July 2024, 2:52 AM
 

Hi,

I have a question related to the timing of the course due date notification. As I understand it, if the notification is set to be sent 1 day before the due date, it would require the corresponding cron job to run at <=24 hours for it to be sent out at that particular run (if it's set to run daily). Is that a correct assumption?

However, if a fixed course due date is set, which exact time is taken here? If it's set to July 9, is it July 9 at 00:00 or 24:00 - or something else entirely?

How would the notification be sent out if, let's say, the process_scheduled_event_task runs at 10 am daily and the course due date is set to July 9. Would it be sent on July 8 at 10 am or July 9 at 10 am?

I'm currently not able to get this to work (I was expecting the notification to be sent out on the same day at 10 am but that didn't happen), and looking at the corresponding article (https://totara.help/docs/course-due-dates), the examples always assume a concrete time on the day to be set (e.g., 18:00), which doesn't seem to be possible with the fixed course due date as opposed to the relative one.

Thanks a lot!

Craig Eves
Re: Course due date notification
by Craig Eves (Totara Support) - Tuesday, 9 July 2024, 3:47 PM
Group Totara

Hi Christina

There is an explanation of how the scheduled notifications are processed - it changed in Totara 17 so the scheduled notification task calculates the period since the last time it was run, applies the offsets of the scheduled notifications, and asks each notification to calculate all events that occurred during these offset periods.

For example, let's take a notification that is scheduled to be sent three days before an event occurs, such as a due date. The scheduled task is configured to run once a day by default, at 11pm. When it runs at 11pm, for the given notification, the period it calculates will be 'last cron run + 3 days' to 'now + 3 days'. The notification resolver (the piece of code which defines how an individual notification works, what data is involved, etc.) will be asked to find all events that occur during this period. For a notification to be sent, the event date must lie within this period.

I added a fixed due due date to the course and looked at the value store in the database and this is showing as 00:00 on the date.

Hopefully that helps it is quite complex and I am struggling to understand too.


Regards

Christina Stoll
Re: Course due date notification
by Christina Stoll - Thursday, 18 July 2024, 8:15 AM
 

Hi Craig,

thanks a lot for your reply! Yes, after some more testing I can confirm that it has to be 00:00 for any given due date that is set. It then ended up working for me as expected.

Thanks & all the best,

Christina