linusshops/module-kickbox

安装次数: 1,966

依赖项: 0

建议者: 0

安全性: 0

星级: 0

关注者: 8

分支: 0

公开问题: 1

类型:magento2-module

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

This package is not auto-updated.

Last update: 2024-09-15 02:53:22 UTC


README

Kickbox.io 邮箱验证 for Magento 2

本模块是对 Kickbox.io php api library 的封装。

基于 linusshops/kickbox-magento 为 Magento 1。

使用方法

验证邮箱

注入 LinusShops\Kickbox\Model\EmailVerifier 以访问验证。

$email = 'test@example.com';

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

使用响应模型验证邮箱

$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();

使用ajax端点进行客户端验证

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
	}
}

为了获得最佳结果,请使用 Common.ajax 进行自动解析。 https://github.com/linusshops/module-common

作者

Samuel Schmidt

许可证

MIT