Where is Forum email function coded

Where is Forum email function coded

by Jaswant Tak -
Number of replies: 1

Hi,

Can you please tell me where the Discussion forum email function is written, basically the email which goes to all subscribers. 


I think there should be two seperate functions, one which will send if 'Mail Now' is checked and other may be during cron execution. Can anyone please help me two find those two functions.


Basically I want to capture all the data like towhome, fromwhom, subject, message etc. once the email is sent. 


Thank you

Jaswant

Average of ratings: -
In reply to Jaswant Tak

Re: Where is Forum email function coded

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Jaswant,

It can all be found in mod/forum/lib.php in the forum_cron() function.

The 'mailnow' setting (which has now been renamed) skips the standard 30 minute wait time. It does not cause the message to be sent 'immediately' as this would create a less-than satisfactory experience for the user writing the message (they'd have to wait for Moodle to work out who to send it to, and send each individual message).

What are you hoping to do with this information? There may be a better way to achieve this if you post your goal rather than the implementation you think you need.

Hope this helps,

Andrew