PHP code example of fcosrno / sendgrid-report

1. Go to this page and download the library: Download fcosrno/sendgrid-report library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fcosrno / sendgrid-report example snippets


$sendgrid = new Fcosrno\SendGridReport\SendGrid('username', 'password');
$report = new Fcosrno\SendGridReport\Report();
$report->spamreports();
$result = $sendgrid->report($report);



$sendgrid = new Fcosrno\SendGridReport\SendGrid('your_sendgrid_username', 'your_sendgrid_password');

$report = new Fcosrno\SendGridReport\Report();
$report->spamreports()->email('[email protected]');
$result = $sendgrid->report($report);

$sendgrid = new Fcosrno\SendGridReport\SendGrid('your_sendgrid_username', 'your_sendgrid_password');
$report = new Fcosrno\SendGridReport\Report();
$report->spamreports()->date();
$result = $sendgrid->report($report);

$sendgrid = new Fcosrno\SendGridReport\SendGrid('your_sendgrid_username', 'your_sendgrid_password');
$report = new Fcosrno\SendGridReport\Report();
$report->spamreports()->date()->days(1)->startDate('2014-01-01')->email('[email protected]');
$result = $sendgrid->report($report);

$sendgrid = new Fcosrno\SendGridReport\SendGrid('your_sendgrid_username', 'your_sendgrid_password');
$report = new Fcosrno\SendGridReport\Report();
$report->blocks()->delete()->email('[email protected]');
$result = $sendgrid->report($report);

$report = new Fcosrno\SendGridReport\Report();
$report->blocks();
$result = $sendgrid->report($report);

$report = new Fcosrno\SendGridReport\Report();
$report->bounces();
$result = $sendgrid->report($report);

$report = new Fcosrno\SendGridReport\Report();
$report->bounces()->email('[email protected]');
$result = $sendgrid->report($report);

$report = new Fcosrno\SendGridReport\Report();
$report->invalidemails();
$result = $sendgrid->report($report);

$report = new Fcosrno\SendGridReport\Report();
$report->spamreports();
$result = $sendgrid->report($report);

$report = new Fcosrno\SendGridReport\Report();
$report->unsubscribes();
$result = $sendgrid->report($report);
bash