Skip to content

evensi/php-nomorebounce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wrapper NoMoreBounce API

Latest Stable Version License

A simple interface to NoMoreBounce APIs.

See NoMoreBounce documentation for info on the service.

Installation

Install the package through composer:

composer require brickheadz/php-nomorebounce

Make sure, that you include the composer autoloader somewhere in your codebase.

Basic usage

  • Create (or copy from examples folder) a credentials.json file with connector_id and token fields
{
    "connector_id": <YOUR_CONNECTOR_ID>,
    "token": <YOUR_TOKEN>
}
  • Create a new instance of NoMoreBounce and pass the path of credentials.json file
use brickheadz\NoMoreBounce\NoMoreBounce;

// Save path to file into variable
$credential_path = __DIR__ . '/credentials.json';
// Instance NoMoreBounce class
$NoMoreBounce = new NoMoreBounce($credential_path);
// Call all needed method from $NoMoreBounce object

Examples

  • Validate email :
$response = $NoMoreBounce->checkEmail('[email protected]');
if ($response) {
    echo "Valid mailbox found";
} else {
    echo "No valid mailbox found";
}
  • Create list of emails :
$emailList = ['[email protected]', '[email protected]'];

$response = $NoMoreBounce->createListWithEmails([$emailList])

Etc.

Known issues

  • API account/credits is broken at the moment, if you call the relative function an Exception will thrown due to invalid response.
  • API check/ is a POST request not a GET one, the relative function will already use the right method.

Contribute

We welcome any contribution to this library. Feel free to clone this repository, make the desired code changes, test locally (you need a token and connector_id)

$ composer dump-autoload
$ php  examples/test.php

and send a Pull Request.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages