elfuvo/yii2-postman 问题修复 & 功能扩展

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

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

elfuvo/yii2-postman

Composer 安装命令:

composer require elfuvo/yii2-postman

包简介

Collect E-mails from different sources for mailing

README 文档

README

Latest Stable Version Build Total Downloads License Yii2

Requirements

  • PHP >=7.1

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist elfuvo/postman "~0.0.2"

or add into composer.json

"elfuvo/postman": "~0.0.2"

Use:

In common config define classes

[
    'container' => [
        'definitions' =>[
            \elfuvo\postman\processor\ProcessorInterface::class => [
                'class' => \app\modules\postman\processor\MailProcessor::class,
                'collectors' => [
                    \elfuvo\postman\collector\TextInputCollector::class,
                ],
            ],
            \elfuvo\postman\result\ResultInterface::class => \elfuvo\postman\result\CacheContinuesResult::class,
        ],
    ]
];

For using DatabaseContinuesResult add migration path "@elfuvo/postman/migrations" to console config.

[
    'controllerMap' => [
        'migrate' => [
            'class' => \yii\console\controllers\MigrateController::class,
            'migrationTable' => '{{%migration}}',
            'useTablePrefix' => true,
            'interactive' => false,
            'migrationPath' => [
                '@elfuvo/postman/migrations',
            ],
        ]
    ]
];

in backend config define module

[
    'modules' => [
         'postman' => [
            'class' => \yii\base\Module::class,
            'controllerNamespace' => 'elfuvo\postman\controllers\backend',
        ],
    ]
];

if you don't want to use queue jobs create your own controller and set useQueue property for IndexAction as false

class DefaultController extends Controller
{
    /**
     * @return array|string[]
     */
    public function actions()
    {
        return [
            'index' => [
                'class' => IndexAction::class,
                'view' => '@app/modules/postman/views/backend/default/index', // path to custom template
                'useQueue' => true, // use or not Yii2 queue for mailing
            ],
            'progress' => ProgressAction::class,
            'view' => ViewAction::class,
        ];
    }
}

You can create custom collector of emails, see examples. After creating collector add it in common config.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-06-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固