public function message_admins($notice) {

        $site = get_site();

        $subject = get_string('emailsubject', 'antivirus', format_string($site->fullname));
        $admins = get_admins();
        foreach ($admins as $admin) {
            $eventdata = new \core\message\message();
            $eventdata->courseid          = SITEID;
            $eventdata->component         = 'moodle';
            $eventdata->name              = 'errors';
            $eventdata->userfrom          = get_admin();
            $eventdata->userto            = $admin;
            $eventdata->subject           = $subject;
            $eventdata->fullmessage       = $notice;
            $eventdata->fullmessageformat = FORMAT_PLAIN;
            $eventdata->fullmessagehtml   = '';
            $eventdata->smallmessage      = '';
            message_send($eventdata);
        }
    }
public function message_admins($notice) {

        $site = get_site();

        $subject = get_string('emailsubject', 'antivirus', format_string($site->fullname));
        $admins = get_admins();
        foreach ($admins as $admin) {
            $eventdata = new \core\message\message();
            $eventdata->courseid          = SITEID;
            $eventdata->component         = 'moodle';
            $eventdata->name              = 'errors';
            $eventdata->userfrom          = get_admin();
            $eventdata->userto            = $admin;
            $eventdata->subject           = $subject;
            $eventdata->fullmessage       = $notice;
            $eventdata->fullmessageformat = FORMAT_PLAIN;
            $eventdata->fullmessagehtml   = '';
            $eventdata->smallmessage      = '';
            message_send($eventdata);
        }
    }
public function message_admins ( $ notice ) { $ site = get_site ( ) ; $ subject = get_string ( 'emailsubject' , 'antivirus' , format_string ( $ site -> fullname ) ) ; $ admins = get_admins ( ) ; foreach ( $ admins as $ admin ) { $ eventdata = new \ core \ message \ message ( ) ; $ eventdata -> courseid = SITEID ; $ eventdata -> component = 'moodle' ; $ eventdata -> name = 'errors' ; $ eventdata -> userfrom = get_admin ( ) ; $ eventdata -> userto = $ admin ; $ eventdata -> subject = $ subject ; $ eventdata -> fullmessage = $ notice ; $ eventdata -> fullmessageformat = FORMAT_PLAIN ; $ eventdata -> fullmessagehtml = '' ; $ eventdata -> smallmessage = '' ; message_send ( $ eventdata ) ; } }
Email admins about antivirus scan outcomes.

@param string $notice The body of the email to be sent.
@return void
Email admins about antivirus scan outcomes .