<commit_before># sendgrid-report-php

[![Build Status](https://travis-ci.org/fcosrno/sendgrid-report-php.svg)](https://travis-ci.org/fcosrno/sendgrid-report-php) [![Latest Stable Version](https://poser.pugx.org/fcosrno/sendgrid-report/v/stable.svg)](https://packagist.org/packages/fcosrno/sendgrid-report) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/badges/coverage.png?b=master)](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

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


## 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. 

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

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

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

## 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

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

```php<commit_msg>Direct download example in README<commit_after># sendgrid-report-php

[![Build Status](https://travis-ci.org/fcosrno/sendgrid-report-php.svg)](https://travis-ci.org/fcosrno/sendgrid-report-php) [![Latest Stable Version](https://poser.pugx.org/fcosrno/sendgrid-report/v/stable.svg)](https://packagist.org/packages/fcosrno/sendgrid-report) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/fcosrno/sendgrid-report-php/badges/coverage.png?b=master)](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

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


## 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. 

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

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

```bash
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.

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

## 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

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

```php
{'fraction_non_alphanumeric': 0.13409540558364474, 'fraction_numerical': 0.00043965706748735987, 'mean_word_length': 5.091030789825971, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 19, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '843464', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1425, 'n_words': 390}