Hi,
Gareth Barnard and I tried to override the renderer for sending email via the forum. Unfortunately we were not very successful. You can have a look at our different approaches:
1) Modify theme core renderer:
/theme/campus/classes/core_renderer.php and add that (setting 2nd param to true should send email as plaintext, which did not work)
class theme_campus_mod_forum_renderer extends mod_forum_renderer {
$data = $post->export_for_template($this, true);
return $this->render_from_template('mod_forum/' . $this->forum_post_template(), $data);
}
Also that did not work: https://github.com/dasistwas/moodle-theme_campus/commit/29e7e7dddaba2f3fa5f5c36116a9d456f4e10561#diff-6de519938595b6e8b92f56fc5aba0259Link to second approach
Does not work either
These are the approaches taken from https://docs.moodle.org/dev/Overriding_a_renderer
The intention of the renderers is, that they can be overridden, but obviously that is not the case here. My assumption is, that cronjob just ignores themes totally and thus overriding via the theme won't work for cronjob tasks.
The goal would be to send a custom header and footer in every forum post. I think we can not achieve that by just modifying the template, which is quite easy to do.
Any help would be very appreciated.
Kind regards,
David