alexeevdv/yii2-chain-mailer

安装: 206

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

2.0.0 2018-07-16 05:21 UTC

This package is auto-updated.

Last update: 2024-08-29 04:25:45 UTC


README

Build Status codecov PHP 5.6 PHP 7.0 PHP 7.1 PHP 7.2

Yii2 邮件发送实现,允许您使用多个子邮件发送器。

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

$ php composer.phar require alexeevdv/yii2-chain-mailer "~2.0"

或者将以下内容添加到您的 composer.json 文件的 require 部分:

"alexeevdv/yii2-chain-mailer": "~2.0"

require 部分。

配置

通过应用程序组件

//...
'components' => [
    //...
    'mailer' => [
        'class' => \alexeevdv\yii\ChainMailer::class,
        'mailers' => [
            [
                'class' => \yii\swiftmailer\Mailer::class,
                'userFileTransport' => true,
            ],
            [
                'class' => \alexeevdv\yii\SlackMailer::class,
                'webhook' => 'https://web.hook',
            ],
            // even more mailers here
        ],
    ],
    //...
],
//...

限制

如果您使用 embedembedContent 方法,请注意,CID 只会为第一个配置的邮件发送器返回。请记住这一点。