<commit_before>EzMail
=======

Created by <NAME>

> Note that API calls are not currently unit-tested (although we have properly test them manually). Therefore, you
are encouraged to test your API usage before going into production.

Introduction
------------

EzMail is a module that integrates with various third-parties API to send mails. Integration is provided with the
API of those services. It does not handle SMTP.

Please note that EzMail only supports Transactional services. Services for campaign marketing emails (like MailChimp
or MailJet) are out-of-the scope of this module.

Here are the currently supported services:

* [Amazon SES](http://aws.amazon.com/ses) (nearly complete)
* [Elastic Email](http://elasticemail.com) (complete)
* [Mailgun](http://www.mailgun.com) (complete)
* [Mandrill](http://mandrill.com) (complete)
* [Postmark](https://postmarkapp.com) (complete)
* [Postage](http://postageapp.com) (complete)
* [Send Grid](http://sendgrid.com) (nearly complete)

Requirements
------------

* PHP 5.3
* [Zend Framework 2](https://github.com/zendframework/zf2)
* [Amazon AWS ZF 2 Module](https://github.com/aws/aws-sdk-php-zf2): only if you plan to use Amazon SES service

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

Add `"misarji/ez-mail"` to your `composer.json` file and update your dependencies. Enable `EzMail` in your
`application.config.php`. To use one of the transport layers, see the documentation in the [docs](https://github.com/misarji/EzMail/tree/master/docs) folder.

If you do not have a `composer.json` file in the root of your project, copy the contents below and put that into a
file called `composer.json` and save it in the root of your project:

```
{
    "require": {
        "misarji/ez-mail": "~1.5"
    }
}
```

Then execute the following commands in a CLI:

```
curl -s http://getcomposer.org/installer | php
php composer.phar install
```

Now you should have a `vendor` directory, including a `slm/mail`. In your bootstrap code, make sure
you include the `vendor/autoload.php` file to properly load the EzMail module.

### Amazon SES

If you want to use Amazon SES, you need to install the official AWS ZF 2 module. Please refer to the documentation
of Amazon SES in the [docs](https://github.com/misarji/EzMail/tree/master/docs) folder.

Documentation
-------------

Documentation for EzMail is splitted for each provider:

* [Amazon SES](/docs/Ses.md)
* [Elastic Email](/docs/ElasticEmail.md)
* [Mailgun](/docs/Mailgun.md)
* [Mandrill](/docs/Mandrill.md)
* [Postage](/docs/Postage.md)
* [Postmark](/docs/Postmark.md)
* [SendGrid](/docs/SendGrid.md)

Cook-book
---------

### How to send an HTML email ?

Every email providers used in EzMail allow to send HTML emails. However, by default, if you set the mail's content
using the `setBody` content, this content will be considered as the plain text version as shown below:
<commit_msg>Commit<commit_after>EzMail
=======

Created by <NAME>

> Note that API calls are not currently unit-tested (although we have properly test them manually). Therefore, you
are encouraged to test your API usage before going into production.

Introduction
------------

EzMail is a module that integrates with various third-parties API to send mails. Integration is provided with the
API of those services. It does not handle SMTP.

Please note that EzMail only supports Transactional services. Services for campaign marketing emails (like MailChimp
or MailJet) are out-of-the scope of this module.

Here are the currently supported services:

* [Amazon SES](http://aws.amazon.com/ses) (nearly complete)
* [Elastic Email](http://elasticemail.com) (complete)
* [Mailgun](http://www.mailgun.com) (complete)
* [Mandrill](http://mandrill.com) (complete)
* [Postmark](https://postmarkapp.com) (complete)
* [Postage](http://postageapp.com) (complete)
* [Send Grid](http://sendgrid.com) (nearly complete)

Requirements
------------

* PHP 5.3
* [Zend Framework 2](https://github.com/zendframework/zf2)
* [Amazon AWS ZF 2 Module](https://github.com/aws/aws-sdk-php-zf2): only if you plan to use Amazon SES service

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

Add `"misarji/ez-mail"` to your `composer.json` file and update your dependencies. Enable `EzMail` in your
`application.config.php`. To use one of the transport layers, see the documentation in the [docs](https://github.com/misarji/EzMail/tree/master/docs) folder.

If you do not have a `composer.json` file in the root of your project, copy the contents below and put that into a
file called `composer.json` and save it in the root of your project:

```
{
    "require": {
        "misarji/ez-mail": "~1.5"
    }
}
```

Then execute the following commands in a CLI:

```
curl -s http://getcomposer.org/installer | php
php composer.phar install
```

Now you should have a `vendor` directory, including a `misarji/ez-mail`. In your bootstrap code, make sure
you include the `vendor/autoload.php` file to properly load the EzMail module.

### Amazon SES

If you want to use Amazon SES, you need to install the official AWS ZF 2 module. Please refer to the documentation
of Amazon SES in the [docs](https://github.com/misarji/EzMail/tree/master/docs) folder.

Documentation
-------------

Documentation for EzMail is splitted for each provider:

* [Amazon SES](/docs/Ses.md)
* [Elastic Email](/docs/ElasticEmail.md)
* [Mailgun](/docs/Mailgun.md)
* [Mandrill](/docs/Mandrill.md)
* [Postage](/docs/Postage.md)
* [Postmark](/docs/Postmark.md)
* [SendGrid](/docs/SendGrid.md)

Cook-book
---------

### How to send an HTML email ?

Every email providers used in EzMail allow to send HTML emails. However, by default, if you set the mail's content
using the `setBody` content, this content will be considered as the plain text version as shown below:

{'fraction_non_alphanumeric': 0.1307451253481894, 'fraction_numerical': 0.0031337047353760445, 'mean_word_length': 3.9525862068965516, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 10, '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': '2691195', 'n_tokens_mistral': 1807, 'n_tokens_neox': 1728, 'n_words': 662}