2017 © Pedro Peláez
 

symfony-bundle kickbox-bundle

Symfony Kickbox Bundle

image

andi/kickbox-bundle

Symfony Kickbox Bundle

  • Tuesday, July 7, 2015
  • by andi
  • Repository
  • 3 Watchers
  • 3 Stars
  • 3,292 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Kickbox Email Verification Service
, (*1)

SensioLabsInsight, (*2)

Scrutinizer Code Quality Code Coverage Build Status, (*3)

Latest Stable Version Latest Unstable Version License, (*4)

Join the chat at https://gitter.im/AbdoulNdiaye/kickbox-bundle, (*5)

Email Verification Library for Symfony

Kickbox determines if an email address is not only valid, but associated with a actual user. Uses include:, (*6)

  • Preventing users from creating accounts on your applications using fake, misspelled, or throw-away email addresses.
  • Reducing bounces by removing old, invalid, and low quality email addresses from your mailing lists.
  • Saving money and projecting your reputation by only sending to real email users.

Getting Started

To begin, hop over to kickbox.io and create a free account. Once you've signed up and logged in, click on API Settings and then click Add API Key. Take note of the generated API Key - you'll need it to setup the client as explained below., (*7)

Installation

Make sure you have composer installed., (*8)

Add the following to your composer.json, (*9)

$ php composer.phar require andi/kickbox-bundle

This package follows the PSR-4 convention names for its classes, which means you can easily integrate these classes loading in your own autoloader., (*10)

Register the bundle in app/AppKernel.php, (*11)

public function registerBundles()
{
    $bundles = array(
        new Andi\KickBoxBundle\AndiKickBoxBundle(),
    );
}

In your config.yml, you must configure:, (*12)

# Default configuration for extension with alias: "andi_kick_box"
andi_kick_box:

    # API key list.
    api_keys:             # Required
        toto:
            # The api key generated in kickbox.io.
            key: YOU_API_KEY       # Required
        tata:
            key: AN_OTHER_API_KEY
    # The default API name. If not set, the default value will be the first api name. 
    default_api_name: tata

    # The endpoint of the kickbox API.
    endpoint:             'https://api.kickbox.io/v2/verify'

Usage

Add the following code to our controller:, (*13)

public function indexAction($email)
{
    $kickboxClient = $this->get('kickbox_client');
    $response      = $kickboxClient->verify($email);
}

We can also get a service name with a specific key defined in config.yml, (*14)

Example:, (*15)

    $kickboxClient = $this->get('kickbox_client');  // The default client. In our example : tata
    $kickboxClient = $this->get('kickbox_client.tata');
    $kickboxClient = $this->get('kickbox_client.toto');

To simply verify an email :, (*16)

    $response = $kickboxClient->verify($email);

With a timeout :, (*17)

   // Maximum time, in milliseconds, for the API to complete a verification request. Default value : 6000
   $response = $kickboxClient->verify($email, 6000);

An exception can be thrown by the api client if the HTTP status code is not 200 : Andi\KickBoxBundle\Exception\KickBoxApiException, (*18)

Response

A successful API call responds with the following object:, (*19)

    $response->getBalance();      // The remaining credit balance (Daily + On Demand).
    $response->getDomain();       // The domain of the provided email address.
    $response->getEmail();        // Returns a normalized version of the provided email address.
    $response->getReason();       // The reason for the result.
    $response->getResponseTime(); // The elapsed time (in milliseconds) it took Kickbox to process the request.
    $response->getResult();       // The verification result: deliverable, undeliverable, risky, unknown
    $response->getSuggestion();   // Returns a suggested email if a possible spelling error was detected.
    $response->getSendex();       // A quality score of the provided email address ranging between 0 (no quality) and 1 (perfect quality).
    $response->getUser();         // The user (a.k.a local part) of the provided email address. (bob@example.com -> bob).

    $response->isAcceptAll();     // If the email was accepted, but the domain appears to accept all emails addressed to that domain.
    $response->isDisposable();    // If the email address uses a disposable domain like trashmail.com or mailinator.com.
    $response->isFree();          // If the email address uses a free email service like gmail.com or yahoo.com.
    $response->isRole();          // If the email address is a role address
    $response->isSuccess();       // If the API request was successful.

All the Kickbox API is explained here : Using api API, (*20)

The Versions

07/07 2015

dev-master

9999999-dev https://github.com/AbdoulNdiaye/kickbox-bundle

Symfony Kickbox Bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Abdoul Ndiaye

api kickbox

07/07 2015

1.1.0

1.1.0.0 https://github.com/AbdoulNdiaye/kickbox-bundle

Symfony Kickbox Bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Abdoul Ndiaye

api kickbox

06/06 2015

1.0.0

1.0.0.0 https://github.com/AbdoulNdiaye/kickbox-bundle

Symfony Kickbox Bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Abdoul Ndiaye

api kickbox