protected function add_post_body($author, $post, $discussion, $forum, $cm, $course) {
        global $CFG;

        $canreply = $this->canpostto[$discussion->id];

        $data = new \mod_forum\output\forum_post_email(
            $course,
            $cm,
            $forum,
            $discussion,
            $post,
            $author,
            $this->recipient,
            $canreply
        );

        // Override the viewfullnames value.
        $data->viewfullnames = $this->viewfullnames[$forum->id];

        // Determine the type of digest being sent.
        $maildigest = $this->get_maildigest($forum->id);

        $textrenderer = $this->get_renderer($maildigest);
        $this->discussiontext .= $textrenderer->render($data);
        $this->discussiontext .= "\n";
        if ($this->allowhtml) {
            $htmlrenderer = $this->get_renderer($maildigest, true);
            $this->discussionhtml .= $htmlrenderer->render($data);
            $this->log("Adding post {$post->id} in format {$maildigest} with HTML", 2);
        } else {
            $this->log("Adding post {$post->id} in format {$maildigest} without HTML", 2);
        }

        if ($maildigest == 1 && $CFG->forum_usermarksread) {
            // Create an array of postid's for this user to mark as read.
            $this->markpostsasread[] = $post->id;
        }

    }
protected function add_post_body($author, $post, $discussion, $forum, $cm, $course) {
        global $CFG;

        $canreply = $this->canpostto[$discussion->id];

        $data = new \mod_forum\output\forum_post_email(
            $course,
            $cm,
            $forum,
            $discussion,
            $post,
            $author,
            $this->recipient,
            $canreply
        );

        // Override the viewfullnames value.
        $data->viewfullnames = $this->viewfullnames[$forum->id];

        // Determine the type of digest being sent.
        $maildigest = $this->get_maildigest($forum->id);

        $textrenderer = $this->get_renderer($maildigest);
        $this->discussiontext .= $textrenderer->render($data);
        $this->discussiontext .= "\n";
        if ($this->allowhtml) {
            $htmlrenderer = $this->get_renderer($maildigest, true);
            $this->discussionhtml .= $htmlrenderer->render($data);
            $this->log("Adding post {$post->id} in format {$maildigest} with HTML", 2);
        } else {
            $this->log("Adding post {$post->id} in format {$maildigest} without HTML", 2);
        }

        if ($maildigest == 1 && $CFG->forum_usermarksread) {
            // Create an array of postid's for this user to mark as read.
            $this->markpostsasread[] = $post->id;
        }

    }
protected function add_post_body ( $ author , $ post , $ discussion , $ forum , $ cm , $ course ) { global $ CFG ; $ canreply = $ this -> canpostto [ $ discussion -> id ] ; $ data = new \ mod_forum \ output \ forum_post_email ( $ course , $ cm , $ forum , $ discussion , $ post , $ author , $ this -> recipient , $ canreply ) ; // Override the viewfullnames value. $ data -> viewfullnames = $ this -> viewfullnames [ $ forum -> id ] ; // Determine the type of digest being sent. $ maildigest = $ this -> get_maildigest ( $ forum -> id ) ; $ textrenderer = $ this -> get_renderer ( $ maildigest ) ; $ this -> discussiontext .= $ textrenderer -> render ( $ data ) ; $ this -> discussiontext .= "\n" ; if ( $ this -> allowhtml ) { $ htmlrenderer = $ this -> get_renderer ( $ maildigest , true ) ; $ this -> discussionhtml .= $ htmlrenderer -> render ( $ data ) ; $ this -> log ( "Adding post {$post->id} in format {$maildigest} with HTML" , 2 ) ; } else { $ this -> log ( "Adding post {$post->id} in format {$maildigest} without HTML" , 2 ) ; } if ( $ maildigest == 1 && $ CFG -> forum_usermarksread ) { // Create an array of postid's for this user to mark as read. $ this -> markpostsasread [ ] = $ post -> id ; } }
Add the body of this post.

@param   \stdClass   $author The author of the post
@param   \stdClass   $post The post being sent
@param   \stdClass   $discussion The discussion that the post is in
@param   \stdClass   $forum The forum that the discussion belongs to
@param   \cminfo     $cm The cminfo object for the forum
@param   \stdClass   $course The course that the forum belongs to
Add the body of this post .