elfuvo / yii2-postman
Collect E-mails from different sources for mailing
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/elfuvo/yii2-postman
Requires
- php: >=7.1.0
- ext-ctype: *
- ext-dom: *
- ext-fileinfo: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- ext-pcre: *
- ext-reflection: *
- yiisoft/yii2: ~2.0.12
- yiisoft/yii2-queue: ~2.0.0
- yiisoft/yii2-swiftmailer: ~2.0.0
Requires (Dev)
- codeception/codeception: ^4.0
- codeception/module-asserts: ^1.2
- codeception/module-cli: ^1.0
- codeception/module-filesystem: ^1.0.0
- codeception/module-yii2: ^1.1
- symfony/browser-kit: >=2.7 <=4.2.4
This package is auto-updated.
Last update: 2025-10-20 23:00:44 UTC
README
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.