Customizing Emails Sent for Forum Posts?

Customizing Emails Sent for Forum Posts?

by Dustin Elliott -
Number of replies: 2
Hello,

I need to be able to change the format of the emails that get sent by CRON when a new post is made in a forum.

It looks like the format of the emails are using the same CSS as the site because the look of the emails changed when I made some changes to the site and font colors and format.

Can someone tell me where the code is that is used to format the emails?

Thanks,
Dustin

I posted this in the "Forum" forum (http://moodle.org/mod/forum/discuss.php?d=151873) but didn't get any replies.
Average of ratings: -
In reply to Dustin Elliott

Re: Customizing Emails Sent for Forum Posts?

by Aaron Wells -
The cron job for a module (in Moodle 1.9 at least) is declared a function called "<module name>_cron()", in the file "mod/<module name>/lib.php". (see http://docs.moodle.org/en/Cron#Script_overview )

So if you look at "forum_cron()" in "mod/forum/lib.php", that's the cron job for the forum module, which sends out forum emails. Reading through that function, it looks like the body of the emails is generated by "forum_make_mail_text()" and "forum_make_mail_html()", and the CSS files in HTML emails are indeed the same ones used on the normal Moodle site.
In reply to Aaron Wells

Re: Customizing Emails Sent for Forum Posts?

by Dustin Elliott -
Aaron,

Thank you for the detailed answer, I'm sure that will be enough for me to do what I need to do.

Although, it would have made things easier if the CCS for the email was independent of the site code.

Thanks!
Dustin