credy / yii2-zerobounce-client
Yii2 client for zerobounce.net API
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 1
Type:yii2-extension
pkg:composer/credy/yii2-zerobounce-client
Requires
- php: >=7.4
- yiisoft/yii2-httpclient: ^2.0
Requires (Dev)
- codeception/codeception: ^5.0.0 || ^4.0
- codeception/module-asserts: ^3.0 || ^1.1
- codeception/module-yii2: ^1.1
- credy/tc-coding-standard: dev-master
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.0
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' => [
credy\zerobounce\ClientInterface::class => [
'class' => credy\zerobounce\Client::class,
'apiKey' => 'a95c530a7af5f492a74499e70578d150',
],
],
],
Usage
Validate email
$client = yii\di\Instance::ensure(credy\zerobounce\ClientInterface::class);
$result = $client->validate('valid@example.com');
if ($result->isValid()) {
// do your stuff
}
Get credits
$client = yii\di\Instance::ensure(credy\zerobounce\ClientInterface::class);
$credits = $client->getCredits();
Send file
$client = yii\di\Instance::ensure(credy\zerobounce\BulkClientInterface::class);
$result = $client->sendFile('file.csv', 'http://site.com/your-postback-link/');
Read file
$client = yii\di\Instance::ensure(credy\zerobounce\BulkClientInterface::class);
//File uuid received from sendFile response
$result = $client->readFile($uuid);
Delete file
$client = yii\di\Instance::ensure(credy\zerobounce\BulkClientInterface::class);
//File uuid received from sendFile response
$result = $client->deleteFile($uuid);