Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 1.42 KB

README.md

File metadata and controls

61 lines (48 loc) · 1.42 KB

module-kickbox

Kickbox.io email verification for Magento 2

This module is a wrapper for the Kickbox.io php api library.

Based on linusshops/kickbox-magento for Magento 1.

Usage

Verify an email

Inject LinusShops\Kickbox\Model\EmailVerifier for access to verification.

$email = '[email protected]';

//'risky' emails are also considered deliverable
$this->emailVerifier->verifyIsDeliverable($email)

Verify an email using the response model

$verifiedEmail = $this->emailVerifier->verify('[email protected]');
$isValid = $verifiedEmail->isDeliverable();

//Access any of the response fields from Kickbox as magic methods.
$result = $verifiedEmail->result();
$didYouMean = $verifiedEmail->did_you_mean();
$sendex = $verifiedEmail->sendex();

Use the ajax endpoint to verify client-side

http://example.com/en/kickbox/[email protected]

{
	"error": 0,
	"feedback": {
		"message": "Data retrieved successfully!",
		"debug": [],
		"target": ""
	},
	"tpl": [],
	"target": {
		"feedback": "",
		"payload": ""
	},
	"payload": {
		"email": "[email protected]",
		"deliverable": true
	}
}

For best results, use Common.ajax for automagical parsing. https://github.com/linusshops/module-common

Author

Samuel Schmidt

License

MIT