linusshops/module-kickbox

Installs: 1 966

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 7

Forks: 0

Open Issues: 1

Type:magento2-module

dev-develop 2021-12-13 16:43 UTC

This package is not auto-updated.

Last update: 2024-04-28 00:53:18 UTC


README

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 = 'test@example.com';

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

Verify an email using the response model

$verifiedEmail = $this->emailVerifier->verify('info@linusshops.com');
$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/deliverable?email=test@example.com

{
	"error": 0,
	"feedback": {
		"message": "Data retrieved successfully!",
		"debug": [],
		"target": ""
	},
	"tpl": [],
	"target": {
		"feedback": "",
		"payload": ""
	},
	"payload": {
		"email": "samuel@dersam.net",
		"deliverable": true
	}
}

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

Author

Samuel Schmidt

License

MIT