private function notification(\context $context, \stdClass $user, \moodle_url $insighturl, string $fullmessage, string $fullmessagehtml) {

        $message = new \core\message\message();
        $message->component = 'moodle';
        $message->name = 'insights';

        $message->userfrom = \core_user::get_noreply_user();
        $message->userto = $user;

        $message->subject = $this->target->get_insight_subject($this->modelid, $context);

        // Same than the subject.
        $message->contexturlname = $message->subject;
        $message->courseid = $this->get_context_courseid($context);

        $message->fullmessage = $fullmessage;
        $message->fullmessageformat = FORMAT_PLAIN;
        $message->fullmessagehtml = $fullmessagehtml;
        $message->smallmessage = $fullmessage;
        $message->contexturl = $insighturl->out(false);

        message_send($message);
    }