accessd/yii2-async-mailer
最新稳定版本:1.0.1
Composer 安装命令:
composer require accessd/yii2-async-mailer
包简介
Async mailer decorator for Yii2
README 文档
README
Async mailer decorator for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yarcode/yii2-async-mailer
or add
"yarcode/yii2-async-mailer": "*"
Usage
Configure async component of your application.
You can find the details here: https://packagist.org/packages/bazilio/yii2-async
Configure YarCode\Yii2\AsyncMailer\Mailer as your primary mailer.
'mailer' => [
'class' => '\YarCode\Yii2\AsyncMailer\Mailer',
'syncMailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => true,
],
],
Add mailer command to the console config file.
'controllerMap' => [
'mailer' => [
'class' => '\YarCode\Yii2\AsyncMailer\MailerCommand',
],
],
Run the mailer daemon in the background.
yii mailer/daemon
Now you can send your emails as usual.
$message = \Yii::$app->mailer->compose()
->setSubject('test subject')
->setFrom('test@example.org')
->setHtmlBody('test body')
->setTo('user@example.org');
\Yii::$app->mailer->send($message);
统计信息
- 总下载量: 2.19k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-12