<commit_before># SwiftMailer Extension for Yii 2 with Spooling

Implements email queue using [SwiftMailer](http://swiftmailer.org/) spool transport and [yii2-swiftmailer](https://github.com/yiisoft/yii2-swiftmailer) extension.

[![Build Status](https://travis-ci.org/Izumi-kun/yii2-spoolmailer.svg?branch=master)](https://travis-ci.org/Izumi-kun/yii2-spoolmailer)

## Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist izumi-kun/yii2-spoolmailer "*"
```

or add

```
"izumi-kun/yii2-spoolmailer": "*"
```

to the require section of your composer.json.

## Usage

To use this extension, simply add the following code in your application configuration (both web and console):

```php
return [
    //....
    'components' => [
        'mailer' => [
            'class' => 'izumi\spoolmailer\Mailer',
        ],
    ],
];
```

Add the following code in your console configuration:

```php
return [
    //....
    'controllerMap' => [
        'mail' => 'izumi\spoolmailer\MailController',
    ],
];
```

You can then add an email in queue as follows:

```php
Yii::$app->mailer->compose('contact/html')
     ->setFrom('<EMAIL>')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->queue();
```

Process email queue by follow console command:

```
./yii mail/flush
```

CRON job:

```
*/5 * * * * php /var/www/yii-app/yii mail/flush >/dev/null 2>&1
```

Since this extension extends [yii2-swiftmailer](https://github.com/yiisoft/yii2-swiftmailer) for further instructions refer to the [related section in the Yii Definitive Guide](http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html).

## License

BSD-3-Clause
<commit_msg>README.md update [skip ci]<commit_after># SwiftMailer Extension for Yii 2 with Spooling

Implements email queue using [SwiftMailer](http://swiftmailer.org/) spool transport and [yii2-swiftmailer](https://github.com/yiisoft/yii2-swiftmailer) extension.

[![Latest Stable Version](https://poser.pugx.org/izumi-kun/yii2-spoolmailer/v/stable)](https://packagist.org/packages/izumi-kun/yii2-spoolmailer)
[![Total Downloads](https://poser.pugx.org/izumi-kun/yii2-spoolmailer/downloads)](https://packagist.org/packages/izumi-kun/yii2-spoolmailer)
[![Build Status](https://travis-ci.org/Izumi-kun/yii2-spoolmailer.svg?branch=master)](https://travis-ci.org/Izumi-kun/yii2-spoolmailer)

## Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist izumi-kun/yii2-spoolmailer "*"
```

or add

```
"izumi-kun/yii2-spoolmailer": "*"
```

to the require section of your composer.json.

## Usage

To use this extension, add the following code in your application configuration (both web and console):

```php
return [
    //....
    'components' => [
        'mailer' => [
            'class' => 'izumi\spoolmailer\Mailer',
        ],
    ],
];
```

Add the following code in your console configuration:

```php
return [
    //....
    'controllerMap' => [
        'mail' => 'izumi\spoolmailer\MailController',
    ],
];
```

You can then add an email in queue as follows:

```php
Yii::$app->mailer->compose('contact/html')
     ->setFrom('<EMAIL>')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->queue();
```

Process email queue by follow console command:

```
./yii mail/flush
```

CRON job:

```
* * * * * php /var/www/yii-app/yii mail/flush >/dev/null 2>&1
```

Since this extension extends [yii2-swiftmailer](https://github.com/yiisoft/yii2-swiftmailer) for further instructions refer to the [related section in the Yii Definitive Guide](http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html).

## License

BSD-3-Clause

{'fraction_non_alphanumeric': 0.1677571316409317, 'fraction_numerical': 0.008636482596179012, 'mean_word_length': 3.724351050679852, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 12, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1705244', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1342, 'n_words': 282}