dimichspb / yii2-mail-queue
Yii2 mail queue component
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- beberlei/assert: ^2.8
- ramsey/uuid: ^3.7
- yiisoft/yii2: *
- yiisoft/yii2-queue: *
- yiisoft/yii2-swiftmailer: *
Requires (Dev)
- phpunit/phpunit: ^6
This package is not auto-updated.
Last update: 2020-11-14 09:54:29 UTC
README
Yii2 Module to put mails into the queue. Module replaces mailer
component.
- Installation
composer require dimichspb/yii2-mail-queue
- Configuration
add to config files web.php
, console.php
or main.php
for advanced yii2 template
'components' => [
'mailer' => [
'class' => Mailer::className(),
'mailerOptions' => [
'useFileTransport' => true,
],
'useFileTransport' => false,
],
'queue' => [
'class' => \yii\queue\file\Queue::class,
]
],
- Usage
Use mailer
component in common way
$this->app->mailer->compose('example')
->setFrom('from@domain.com')
->setTo('to@domain.com')
->setSubject('Test message subject')
->setTextBody('Test message plain body');
->send();
This will put your message into MailQueue. To process the queue use common queue run command:
yii queue/run
or use yii2 queue listener
yii queue/listen
- Testing
phpunit
- Have fun