original_string: public static function message_viewed(\core\event\message_viewed $event) {
          global $DB;
  
          $userid = $event->userid;
          $messageid = $event->other['messageid'];
  
          $DB->delete_records('message_email_messages', ['useridto' => $userid, 'messageid' => $messageid]);
      }
code: public static function message_viewed(\core\event\message_viewed $event) {
          global $DB;
  
          $userid = $event->userid;
          $messageid = $event->other['messageid'];
  
          $DB->delete_records('message_email_messages', ['useridto' => $userid, 'messageid' => $messageid]);
      }
code_tokens: public static function message_viewed ( \ core \ event \ message_viewed $ event ) { global $ DB ; $ userid = $ event -> userid ; $ messageid = $ event -> other [ 'messageid' ] ; $ DB -> delete_records ( 'message_email_messages' , [ 'useridto' => $ userid , 'messageid' => $ messageid ] ) ; }
docstring: Message viewed event handler.
  
  @param \core\event\message_viewed $event The message viewed event.
docstring_tokens: Message viewed event handler .