Totara Learn Open Discussions

Creating a custom program notification message

 
??
Creating a custom program notification message
?? 发表于 2019年09月30日 Monday 07:45
 

Hello,

I'm working on a development project with Totara to create a new program message template that triggers based on a trigger time of my choosing. I have found most of the relevant places in the core Totara files that will need to be edited in order to create a new message template, but I can't figure out where in the code the trigger time for a message is actually defined. For example, the Program Overdue message is set to trigger X days after the program is due, but where in the code is this value actually converted into a time that can be stored in the database and checked against to determine when to send out the message? 

Thanks for any help. (I'm working with Totara version 12.4.)

LewisNathan
Re: Creating a custom program notification message
LewisNathan 发表于 2019年10月1日 Tuesday 17:36
小组 Totara

Hi Sam.

Have a look at totara/program/classes/task/send_messages_task.php. When it runs, it calculates which things are due to be sent. An easy to read example is program_cron_programs_overdue, with sql "(pc.timedue + pm.triggertime) < :now".

Nathan

??
Re: Creating a custom program notification message
?? 发表于 2019年10月3日 Thursday 12:02
 

Thanks, Nathan, that's very helpful!