Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexeevdv/yii2-zerobounce-client
Yii2 client for zerobounce.net API
https://github.com/alexeevdv/yii2-zerobounce-client
Last synced: about 2 months ago
JSON representation
Yii2 client for zerobounce.net API
- Host: GitHub
- URL: https://github.com/alexeevdv/yii2-zerobounce-client
- Owner: alexeevdv
- License: mit
- Created: 2019-05-02T08:46:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T14:51:19.000Z (about 4 years ago)
- Last Synced: 2024-11-22T16:30:28.122Z (2 months ago)
- Language: PHP
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# yii2-zerobounce-client
[![Build Status](https://travis-ci.com/alexeevdv/yii2-zerobounce-client.svg?branch=master)](https://travis-ci.com/alexeevdv/yii2-zerobounce-client)
[![codecov](https://codecov.io/gh/alexeevdv/yii2-zerobounce-client/branch/master/graph/badge.svg)](https://codecov.io/gh/alexeevdv/yii2-zerobounce-client)
![PHP 7.1](https://img.shields.io/badge/PHP-7.1-green.svg)
![PHP 7.2](https://img.shields.io/badge/PHP-7.2-green.svg)
![PHP 7.3](https://img.shields.io/badge/PHP-7.3-green.svg)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](https://getcomposer.org/download/).
Either run
```bash
$ 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
```php
'container' => [
'singletons' => [
alexeevdv\yii\zerobounce\ClientInterface::class => [
'class' => alexeevdv\yii\zerobounce\Client::class,
'apiKey' => 'a95c530a7af5f492a74499e70578d150',
],
],
],
```## Usage
### Validate email
```php
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\ClientInterface::class);
$result = $client->validate('[email protected]');
if ($result->isValid()) {
// do your stuff
}
```### Get credits
```php
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\ClientInterface::class);
$credits = $client->getCredits();
```### Send file
```php
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class);
$result = $client->sendFile('file.csv', 'http://site.com/your-postback-link/');
```### Read file
```php
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class);
//File uuid received from sendFile response
$result = $client->readFile($uuid);
```### Delete file
```php
$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class);
//File uuid received from sendFile response
$result = $client->deleteFile($uuid);
```