public function get_success_message(\stdClass $messagedata, $handlerresult) {
        $a = new \stdClass();
        $a->subject = $handlerresult->subject;
        $discussionurl = new \moodle_url('/mod/forum/discuss.php', array('d' => $handlerresult->discussion));
        $discussionurl->set_anchor('p' . $handlerresult->id);
        $a->discussionurl = $discussionurl->out();

        $message = new \stdClass();
        $message->plain = get_string('postbymailsuccess', 'mod_forum', $a);
        $message->html = get_string('postbymailsuccess_html', 'mod_forum', $a);
        return $message;
    }
public function get_success_message(\stdClass $messagedata, $handlerresult) {
        $a = new \stdClass();
        $a->subject = $handlerresult->subject;
        $discussionurl = new \moodle_url('/mod/forum/discuss.php', array('d' => $handlerresult->discussion));
        $discussionurl->set_anchor('p' . $handlerresult->id);
        $a->discussionurl = $discussionurl->out();

        $message = new \stdClass();
        $message->plain = get_string('postbymailsuccess', 'mod_forum', $a);
        $message->html = get_string('postbymailsuccess_html', 'mod_forum', $a);
        return $message;
    }
public function get_success_message ( \ stdClass $ messagedata , $ handlerresult ) { $ a = new \ stdClass ( ) ; $ a -> subject = $ handlerresult -> subject ; $ discussionurl = new \ moodle_url ( '/mod/forum/discuss.php' , array ( 'd' => $ handlerresult -> discussion ) ) ; $ discussionurl -> set_anchor ( 'p' . $ handlerresult -> id ) ; $ a -> discussionurl = $ discussionurl -> out ( ) ; $ message = new \ stdClass ( ) ; $ message -> plain = get_string ( 'postbymailsuccess' , 'mod_forum' , $ a ) ; $ message -> html = get_string ( 'postbymailsuccess_html' , 'mod_forum' , $ a ) ; return $ message ; }
Return the content of any success notification to be sent.
Both an HTML and Plain Text variant must be provided.

@param \stdClass $messagedata The message data.
@param \stdClass $handlerresult The record for the newly created post.
@return \stdClass with keys `html` and `plain`.
Return the content of any success notification to be sent . Both an HTML and Plain Text variant must be provided .