private function get_unique_users() : moodle_recordset {
        global $DB;

        $subsql = 'SELECT DISTINCT(useridto) as id
                     FROM {message_email_messages}
                    WHERE id <= ?';

        $sql = "SELECT *
                  FROM {user} u
                 WHERE id IN ($subsql)";

        return $DB->get_recordset_sql($sql, [$this->maxid]);
    }
private function get_unique_users() : moodle_recordset {
        global $DB;

        $subsql = 'SELECT DISTINCT(useridto) as id
                     FROM {message_email_messages}
                    WHERE id <= ?';

        $sql = "SELECT *
                  FROM {user} u
                 WHERE id IN ($subsql)";

        return $DB->get_recordset_sql($sql, [$this->maxid]);
    }
private function get_unique_users ( ) : moodle_recordset { global $ DB ; $ subsql = 'SELECT DISTINCT(useridto) as id
                     FROM {message_email_messages}
                    WHERE id <= ?' ; $ sql = "SELECT *
                  FROM {user} u
                 WHERE id IN ($subsql)" ; return $ DB -> get_recordset_sql ( $ sql , [ $ this -> maxid ] ) ; }
Returns an array of users in the given conversation.

@return moodle_recordset A moodle_recordset instance.
Returns an array of users in the given conversation .