/
var
/
www
/
doncode.com.ua
/
www
/
mailer
/
vendor
/
sendgrid
/
sendgrid
/
examples
/
stats
/
/var/www/doncode.com.ua/www/mailer/vendor/sendgrid/sendgrid/examples/stats
mkdir
upload
Name
Size
Mode
Actions
stats.php
751
0644
edit
dl
rm
Edit:
/var/www/doncode.com.ua/www/mailer/vendor/sendgrid/sendgrid/examples/stats/stats.php
(751B)
<?php // Next line will load dependencies to run this example // Please refer to the README how to use in your project require_once __DIR__ . '/../../sendgrid-php.php'; $apiKey = getenv('SENDGRID_API_KEY'); $sg = new \SendGrid($apiKey); //////////////////////////////////////////////////// // Retrieve global email statistics # // GET /stats # $query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}'); try { $response = $sg->client->stats()->get(null, $query_params); print $response->statusCode() . "\n"; print_r($response->headers()); print $response->body() . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; }
Save
cmd:
run