A simple interface to NoMoreBounce APIs.
See NoMoreBounce documentation for info on the service.
Install the package through composer:
composer require brickheadz/php-nomorebounce
Make sure, that you include the composer autoloader somewhere in your codebase.
- 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
- 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.
- 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.
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.