alexeevdv / yii2-zerobounce-client
Yii2 client for zerobounce.net API
Installs: 6 609
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.1
- yiisoft/yii2-httpclient: ^2.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-15 23:40:38 UTC
README
Yii client for https://www.zerobounce.net API
API docs are available at https://www.zerobounce.net/docs/
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require alexeevdv/yii2-zerobounce-client "^1.0"
or add
"alexeevdv/yii2-zerobounce-client": "^1.0"
to the require
section of your composer.json
file.
Configuration
'container' => [ 'singletons' => [ alexeevdv\yii\zerobounce\ClientInterface::class => [ 'class' => alexeevdv\yii\zerobounce\Client::class, 'apiKey' => 'a95c530a7af5f492a74499e70578d150', ], ], ],
Usage
Validate email
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\ClientInterface::class); $result = $client->validate('valid@example.com'); if ($result->isValid()) { // do your stuff }
Get credits
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\ClientInterface::class); $credits = $client->getCredits();
Send file
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class); $result = $client->sendFile('file.csv', 'http://site.com/your-postback-link/');
Read file
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class); //File uuid received from sendFile response $result = $client->readFile($uuid);
Delete file
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class); //File uuid received from sendFile response $result = $client->deleteFile($uuid);