<commit_before>Mailgun API PHP library
=======================
[![Packagist](https://img.shields.io/packagist/l/baibaratsky/php-mailgun.svg)](https://github.com/baibaratsky/php-mailgun/blob/master/LICENSE.md)
[![Packagist](https://img.shields.io/packagist/v/baibaratsky/php-mailgun.svg)](https://packagist.org/packages/baibaratsky/php-mailgun)
[![Packagist](https://img.shields.io/packagist/dt/baibaratsky/php-mailgun.svg)](https://packagist.org/packages/baibaratsky/php-mailgun)

The library requires PHP 5.2 compiled with [cURL extension](http://www.php.net/manual/en/book.curl.php).


##How to install

0. Install [Composer](http://getcomposer.org/):

    ```
    curl -sS https://getcomposer.org/installer | php
    ```

0. Add php-mailgun dependency:

    ```
    php composer.phar require baibaratsky/php-mailgun:*
    ```


##How to use

It’s pretty easy to send a message using this library:
```php
require_once(__DIR__ . '/vendor/autoload.php'); // Require autoload file generated by composer

$mailgun = new MailgunApi('example.com', 'key-somekey');

$message = $mailgun->newMessage();
$message->setFrom('<EMAIL>', '<NAME>');
$message->addTo('<EMAIL>', 'My dear user');
$message->setSubject('Mailgun API library test');
$message->setText('Amazing! It’s working!');
$message->addTag('test'); // All the Mailgun-specific attributes, such as tags, vars, tracking, etc. are supported

$message->enableTestMode(); // Don’t forget to remove this string if you really want the message to be sent

echo $message->send();
```

Batch sending is also supported. You can use [recipient variables](http://documentation.mailgun.com/user_manual.html#batch-sending) to customize messages.

The library fully supports listing, creating, updating, and deleting of mailing lists and their members:<commit_msg>Readme updated<commit_after>Mailgun API PHP library
=======================
[![Packagist](https://img.shields.io/packagist/l/baibaratsky/php-mailgun.svg)](https://github.com/baibaratsky/php-mailgun/blob/master/LICENSE.md)
[![Packagist](https://img.shields.io/packagist/v/baibaratsky/php-mailgun.svg)](https://packagist.org/packages/baibaratsky/php-mailgun)
[![Packagist](https://img.shields.io/packagist/dt/baibaratsky/php-mailgun.svg)](https://packagist.org/packages/baibaratsky/php-mailgun)

The library requires PHP 5.2 compiled with [cURL extension](http://www.php.net/manual/en/book.curl.php).


##How to install

0. Install [Composer](http://getcomposer.org/):

    ```
    curl -sS https://getcomposer.org/installer | php
    ```

0. Add php-mailgun dependency:

    ```
    php composer.phar require baibaratsky/php-mailgun:1.0.*
    ```


##How to use

It’s pretty easy to send a message using this library:
```php
require_once(__DIR__ . '/vendor/autoload.php'); // Require autoload file generated by composer

$mailgun = new MailgunApi('example.com', 'key-somekey');

$message = $mailgun->newMessage();
$message->setFrom('<EMAIL>', '<NAME>');
$message->addTo('<EMAIL>', 'My dear user');
$message->setSubject('Mailgun API library test');
$message->setText('Amazing! It’s working!');
$message->addTag('test'); // All the Mailgun-specific attributes, such as tags, vars, tracking, etc. are supported

$message->enableTestMode(); // Don’t forget to remove this string if you really want the message to be sent

echo $message->send();
```

Batch sending is also supported. You can use [recipient variables](http://documentation.mailgun.com/user_manual.html#batch-sending) to customize messages.

The library fully supports listing, creating, updating, and deleting of mailing lists and their members:
{'fraction_non_alphanumeric': 0.170873786407767, 'fraction_numerical': 0.0027739251040221915, 'mean_word_length': 5.030100334448161, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4834843', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1156, 'n_words': 268}