strong2much / yii2-bounce
Helper classes for working with email bounces
Installs: 29
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-12-05 07:28:29 UTC
README
Helper classes for working with email bounces.
Installation
Install package by composer
{
"require": {
"strong2much/yii2-bounce": "dev-master"
}
}
Or
$ composer require strong2much/yii2-bounce "dev-master"
Use the following code in your configuration file.
'bounce' => [ 'class' => 'strong2much\bounce\BounceManager' ]
For auto recognition of translation, put this component to bootstrap in your config
'bootstrap' => ['bounce'],
otherwise specify it by yourself in i18n components
'i18n' => [ 'translations' => [ ... 'bounce*' => [ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@strong2much/bounce/messages', ], ... ], ],
You can use it as follows:
//To add bounce report $data = Yii::$app->bounce->parseMessage($emailMessage); foreach($data as $bounceData) { Yii::$app->bounce->pushReport($bounceData['recipient'], $bounceData); } //To check bounce report if(!Yii::$app->bounce->hasReport($email)) { //do some logic }
In order to use full functionality, you will need to apply migrations.