Postmark\PostmarkClient::getOpenStatistics PHP Метод

getOpenStatistics() публичный Метод

Get statistics for tracked messages, optionally filtering by various open event properties.
public getOpenStatistics ( integer $count = 100, integer $offset, string $recipient = NULL, string $tag = NULL, string $clientName = NULL, string $clientCompany = NULL, string $clientFamily = NULL, string $osName = NULL, string $osFamily = NULL, string $osCompany = NULL, string $platform = NULL, string $country = NULL, string $region = NULL, string $city = NULL ) : Postmark\Models\DynamicResponseModel
$count integer The number of open statistics to retrieve in this request.
$offset integer The number of statistics to 'skip' when paging through statistics.
$recipient string Filter by recipient.
$tag string Filter by tag.
$clientName string Filter by Email Client name.
$clientCompany string Filter by Email Client Company's name.
$clientFamily string Filter by Email Client's Family name.
$osName string Filter by Email Client's Operating System Name.
$osFamily string Filter by Email Client's Operating System's Family.
$osCompany string Filter by Email Client's Operating System's Company.
$platform string Filter by Email Client's Platform Name.
$country string Filter by Country.
$region string Filter by Region.
$city string Filter by City.
Результат Postmark\Models\DynamicResponseModel
    function getOpenStatistics($count = 100, $offset = 0, $recipient = NULL, $tag = NULL, $clientName = NULL, $clientCompany = NULL, $clientFamily = NULL, $osName = NULL, $osFamily = NULL, $osCompany = NULL, $platform = NULL, $country = NULL, $region = NULL, $city = NULL)
    {
        $query = array();
        $query['count'] = $count;
        $query['offset'] = $offset;
        $query['recipient'] = $recipient;
        $query['tag'] = $tag;
        $query['client_name'] = $clientName;
        $query['client_company'] = $clientCompany;
        $query['client_family'] = $clientFamily;
        $query['os_name'] = $osName;
        $query['os_family'] = $osFamily;
        $query['os_company'] = $osCompany;
        $query['platform'] = $platform;
        $query['country'] = $country;
        $query['region'] = $region;
        $query['city'] = $city;
        return new DynamicResponseModel($this->processRestRequest('GET', '/messages/outbound/opens', $query));
    }

Usage Example

 function testClientCanGetMessageOpensForSpecificMessage()
 {
     $tk = parent::$testKeys;
     $client = new PostmarkClient($tk->READ_SELENIUM_TEST_SERVER_TOKEN, $tk->TEST_TIMEOUT);
     $stats = $client->getOpenStatistics();
     $messageId = $stats->Opens[0]["MessageID"];
     $result = $client->getOpenStatisticsForMessage($messageId);
     $this->assertNotEmpty($result);
 }