Hi,
I do have to make some corrections. The function export_for_template is not part of the renderer. So overriding this won't work. Instead use this function do override:
public function render_forum_post_email(\mod_forum\output\forum_post_email $post) {
// Was ($this, $this->target === RENDERER_TARGET_TEXTEMAIL) and as we are already 'htmlemail' it will always be false.
$data = $post->export_for_template($this, false);
// Add our new data.
$forumhtmlemailheader = \theme_campus\toolbox::get_setting('forumhtmlemailheader', 'format_html');
if ($forumhtmlemailheader) {
$data['messageheader'] = $forumhtmlemailheader;
}
$forumhtmlemailfooter = \theme_campus\toolbox::get_setting('forumhtmlemailfooter', 'format_html');
if ($forumhtmlemailfooter) {
$data['messagefooter'] = $forumhtmlemailfooter;
}
return $this->render_from_template('mod_forum/' . $this->forum_post_template(), $data);
}