the-real-start / yii2-async-notifications
Notification component to run async mail,push and sms notifications sending.
Installs: 39
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- ext-amqp: *
- ext-curl: *
- bryglen/yii2-apns-gcm: ~1.0.4
- php-amqplib/php-amqplib: ^2.6
- the-real-start/enums: *
- yiisoft/yii2-swiftmailer: *
This package is not auto-updated.
Last update: 2025-01-04 20:58:06 UTC
README
Overview
Purpose of this package is to build easy to use asyncronious notification system in yii2 project.
Package allowes to send e-mail, and push notifications to apple and google play cloud.
For queue management Rabbit MQ is used.
Package is pretty raw and has a lot of rooms for improvement.
We are open to new pull requests, suggestions.
Install
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist the-real-start/yii2-async-notifications "*"
or add
"the-real-start/yii2-async-notifications": "*"
to the require section of your composer.json file.
Configuration
In common/config/main-local.php
add amqp
component:
...
'amqp' => [
'class' => TRS\AsyncNotification\components\amqp\Amqp::className(),
'host' => '127.0.0.1',
'port' => 5672,
'user' => 'guest',
'password' => 'guest',
'vhost' => '/',
'exchange' => 'my-exchange-name',
'exchangeType' => \TRS\AsyncNotification\components\amqp\Amqp::TYPE_DIRECT,
'exchangeArgs' => []
],
...
Change parameters depending on your local environment.
This component set's up connection with rabbitmq.
Then setup notifications you'd like to proceed.
For instance mail:
...
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => false,
],
...
Work in progress