PHPackages                             fcosrno/sendgrid-report - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. fcosrno/sendgrid-report

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

fcosrno/sendgrid-report
=======================

PHP wrapper to view and manage SendGrid reports through the SendGrid Web API.

v1.0.0(11y ago)142026[2 issues](https://github.com/fcosrno/sendgrid-report-php/issues)MITPHPPHP &gt;=5.3

Since Sep 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/fcosrno/sendgrid-report-php)[ Packagist](https://packagist.org/packages/fcosrno/sendgrid-report)[ Docs](http://github.com/fcosrno/sendgrid-report-php)[ RSS](/packages/fcosrno-sendgrid-report/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

sendgrid-report-php
===================

[](#sendgrid-report-php)

[![Build Status](https://camo.githubusercontent.com/556e691e34bbd18fdc0c26029066308495444bf244c91cbfd9f7fdef41082073/68747470733a2f2f7472617669732d63692e6f72672f66636f73726e6f2f73656e64677269642d7265706f72742d7068702e737667)](https://travis-ci.org/fcosrno/sendgrid-report-php) [![Latest Stable Version](https://camo.githubusercontent.com/f1eef95dd186d8e59e772330a6d9d48ce10afd8f7156fbe4da1e49a1bc604db1/68747470733a2f2f706f7365722e707567782e6f72672f66636f73726e6f2f73656e64677269642d7265706f72742f762f737461626c652e737667)](https://packagist.org/packages/fcosrno/sendgrid-report) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/7165e5f1740006c3d8694e7cc42643ef9d79c63b5c6e6df7dfd04bd5c6411833/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66636f73726e6f2f73656e64677269642d7265706f72742d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/873be11e3e02674eed1a3ad7889039aba4a13960ece998962b4a9cd5551894c1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66636f73726e6f2f73656e64677269642d7265706f72742d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/?branch=master)

PHP wrapper to view and manage SendGrid reports through the Web API.

This library extends the [official sendgrid-php library](https://github.com/sendgrid/sendgrid-php). For consistency, it follows the same coding style, dependencies and conventions.

Quick usage
-----------

[](#quick-usage)

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

Installation
------------

[](#installation)

Add SendGrid Report to your `composer.json` file. If you are not using [Composer](http://getcomposer.org), you should be. It's an excellent way to manage dependencies in your PHP application.

```
{
  "require": {
    "fcosrno/sendgrid-report": "1.*"
  }
}
```

Then at the top of your PHP script require the autoloader:

```
require 'vendor/autoload.php';
```

If you do not wish to use Composer, you can [download the latest release](https://github.com/fcosrno/sendgrid-report-php/archive/master.zip). Then include the two library files in the src folder.

```
require_once('/path/to/SendGrid.php');
require_once('/path/to/Report.php');
```

Example App
-----------

[](#example-app)

There is an example in `doc/example.php` to help jumpstart your development.

The `example.php` file requires a `example_params.json` file that contains your SendGrid credentials. The json file is in `.gitignore`, so no worries about accidental commits there. For your convenience, an example of this json file is included in `doc/example_params_placeholder.json` so that you can simply copy/paste that file and rename it to `example_params.json`.

Usage
-----

[](#usage)

To begin using this library, initialize the SendGrid object with your SendGrid credentials.

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

Create a new SendGrid Report object and add your method details.

```
$report = new Fcosrno\SendGridReport\Report();
$report->spamreports()->email('foo@bar.com');
$result = $sendgrid->report($report);
```

You can get Spam Reports, Blocks, Bounces, Invalid Emails, and Unsubscribes as defined in the [SendGrid Web API](https://sendgrid.com/docs/API_Reference/Web_API/index.html). Actions and parameters are chainable to the method. The `get` action is inferred by default.

For example, this GET request has a date parameter.

```
https://api.sendgrid.com/api/spamreports.get.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password&date=1

```

The equivalent would look like this:

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

You can keep linking parameters:

```
$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('foo@bar.com');
$result = $sendgrid->report($report);
```

If you want to use another action like `delete`, `add` or `count`, just add it to the chain like this:

```
$sendgrid = new Fcosrno\SendGridReport\SendGrid('your_sendgrid_username', 'your_sendgrid_password');
$report = new Fcosrno\SendGridReport\Report();
$report->blocks()->delete()->email('foo@bar.com');
$result = $sendgrid->report($report);
```

### Blocks

[](#blocks)

Returns list of blocks with the status, reason and email

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

### Bounces

[](#bounces)

Returns list of bounces with status, reason and email.

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

With parameter, an optional email address to search for.

```
$report = new Fcosrno\SendGridReport\Report();
$report->bounces()->email('foo@bar.com');
$result = $sendgrid->report($report);
```

### Invalid Emails

[](#invalid-emails)

Returns list of invalid emails with the reason and email.

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

### Spam Reports

[](#spam-reports)

Returns list of spam reports with the ip and email.

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

### Unsubscribes

[](#unsubscribes)

Requires API access for unsubscribes.

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

Contributing
------------

[](#contributing)

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Testing
-------

[](#testing)

Tests are built with [PHPUnit](https://github.com/sebastianbergmann/phpunit/).

Make sure you install with dev requirements.

```
composer install
```

Go to the root of the project then run all tests by typing in the terminal:

```
phpunit
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4310d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bd49761575d11cdd4ec59918d312e20fcb3666f6c58c4609c9507963ee82febb?d=identicon)[fcosrno](/maintainers/fcosrno)

---

Top Contributors

[![fcosrno](https://avatars.githubusercontent.com/u/583992?v=4)](https://github.com/fcosrno "fcosrno (20 commits)")[![dejami-jbauer](https://avatars.githubusercontent.com/u/7025336?v=4)](https://github.com/dejami-jbauer "dejami-jbauer (2 commits)")[![jackmcdade](https://avatars.githubusercontent.com/u/44739?v=4)](https://github.com/jackmcdade "jackmcdade (1 commits)")

---

Tags

sendgridspamblocksreportsBouncesInvalid EmailsUnsubscribes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fcosrno-sendgrid-report/health.svg)

```
[![Health](https://phpackages.com/badges/fcosrno-sendgrid-report/health.svg)](https://phpackages.com/packages/fcosrno-sendgrid-report)
```

###  Alternatives

[iandenh/cakephp-sendgrid

SendgridEmail plugin for CakePHP

16126.1k](/packages/iandenh-cakephp-sendgrid)[bryglen/yii2-sendgrid

Sendgrid Mailer for Yii 2

1353.7k](/packages/bryglen-yii2-sendgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
