original_string: protected function notify($touser, $fromuser, $name='courserequested', $subject, $message, $courseid = null) {
          $eventdata = new \core\message\message();
          $eventdata->courseid          = empty($courseid) ? SITEID : $courseid;
          $eventdata->component         = 'moodle';
          $eventdata->name              = $name;
          $eventdata->userfrom          = $fromuser;
          $eventdata->userto            = $touser;
          $eventdata->subject           = $subject;
          $eventdata->fullmessage       = $message;
          $eventdata->fullmessageformat = FORMAT_PLAIN;
          $eventdata->fullmessagehtml   = '';
          $eventdata->smallmessage      = '';
          $eventdata->notification      = 1;
          message_send($eventdata);
      }
code: protected function notify($touser, $fromuser, $name='courserequested', $subject, $message, $courseid = null) {
          $eventdata = new \core\message\message();
          $eventdata->courseid          = empty($courseid) ? SITEID : $courseid;
          $eventdata->component         = 'moodle';
          $eventdata->name              = $name;
          $eventdata->userfrom          = $fromuser;
          $eventdata->userto            = $touser;
          $eventdata->subject           = $subject;
          $eventdata->fullmessage       = $message;
          $eventdata->fullmessageformat = FORMAT_PLAIN;
          $eventdata->fullmessagehtml   = '';
          $eventdata->smallmessage      = '';
          $eventdata->notification      = 1;
          message_send($eventdata);
      }
code_tokens: protected function notify ( $ touser , $ fromuser , $ name = 'courserequested' , $ subject , $ message , $ courseid = null ) { $ eventdata = new \ core \ message \ message ( ) ; $ eventdata -> courseid = empty ( $ courseid ) ? SITEID : $ courseid ; $ eventdata -> component = 'moodle' ; $ eventdata -> name = $ name ; $ eventdata -> userfrom = $ fromuser ; $ eventdata -> userto = $ touser ; $ eventdata -> subject = $ subject ; $ eventdata -> fullmessage = $ message ; $ eventdata -> fullmessageformat = FORMAT_PLAIN ; $ eventdata -> fullmessagehtml = '' ; $ eventdata -> smallmessage = '' ; $ eventdata -> notification = 1 ; message_send ( $ eventdata ) ; }
docstring: Send a message from one user to another using events_trigger
  
  @param object $touser
  @param object $fromuser
  @param string $name
  @param string $subject
  @param string $message
  @param int|null $courseid
docstring_tokens: Send a message from one user to another using events_trigger