frenzelgmbh/yii2-email-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

frenzelgmbh/yii2-email-manager

Composer 安装命令:

composer require frenzelgmbh/yii2-email-manager

包简介

Yii2 Email Manager

README 文档

README

Enhanced E-Mail Module based upon the original code from:

yarcode/yii2-email-manager

Had to adpopt a couple of things to use it within our projects. Feel free to participate;)

Installation

Add the following line to your composer.json require section:

"FrenzelGmbH/yii2-email-manager" : "*",

After this you have to modify your configuration files like:

Simple configuration:

'components' => [
    'emailManager' => [
        'class' => '\net\frenzel\email\EmailManager',
        'transports' => [
            'yiiMailer' => '\net\frenzel\email\transports\YiiMailer'
        ],
    ],
]

Multi transport configuration:

'components' => [
    'emailManager' => [
        'class' => '\net\frenzel\email\EmailManager',
        'defaultTransport' => 'yiiMailer',
        'transports' => [
            'yiiMailer' => [
                'class' => '\net\frenzel\email\transports\YiiMailer',
            ],
        ],
    ],
]

Add command to the list of the available commands. Put it into console app configuration:

'controllerMap' => [
    'email' => '\net\frenzel\email\commands\EmailCommand',
],

Add email sending daemon into crontab via lockrun or run-one utils:

*/5 * * * * run-one php /your/site/path/yii email/run-spool-daemon

OR, if you will use cboden/ratchet

*/5 * * * * run-one php /your/site/path/yii email/run-loop-daemon

Usage

// obtain component instance
$emailManager = EmailManager::geInstance();
// direct send via default transport
$emailManager->send('from@example.com', 'to@example.com', 'test subject', 'test email');
// queue send via default transport
$emailManager->send('from@example.com', 'to@example.com', 'test subject', 'test email');
// direct send via selected transport
$emailManager->transports['mailGun']->send('from@example.com', 'to@example.com', 'test subject', 'test email');

// use shortcuts
EmailTemplate::findByShortcut('shortcut_name')->queue('recipient@email.org', ['param1' => 1, 'param2' => 'asd']);

统计信息

  • 总下载量: 46
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固