Email Verification Widget integration guide
The widget is a quick and easy way to add email verification without building your own integration. Listed below is the primary code snippet to integrate the Email Verification Widget into your website or form.
Customise to your needs - configuration options and available metadata.
How to integrate
Make sure you have access to the website or the form you want to add the widget to. Then follow the steps below:
- Copy and paste the javascript code snippet (below) into the HTML of your webpage. Ideally insert immediately before the closing
</body>
tag - Replace the
licenceKey
, in the code snippet, with your Addressfinder account key. You can find it in under Credentials in the Addressfinder Portal. - Update the
addressSelector
, in the code snippet, with the ID of your email collection field. Alternatively, you could use a CSS selector such asinput[type=email]
inplace of the email field ID - Add the URL of your website (eg, https://website.com) to the domains page in the Addressfinder Portal. Required for authentication of the queries made with your license Key
- Test the widget by entering different email addresses to the email field. Check the results and if necessary, adjust the rules to suit your needs
If you don't have an Addressfinder account, sign up for a free trial.
Javascript code snippet
Below is the javascript code of the EV widget. This code snippet contains the default settings for the various customisable options.
<script>
(function (d) {
var conf = {
addressSelector: '#your_email_field_id',
licenceKey: "your_Addressfinder_key",
check: "domain,connection",
provider: false,
rules: {
disposable: {
rule: "block",
Message: "Disposable email addresses are not permitted."
},
role: {
rule: "allow"
},
public: {
rule: "allow"
},
unverified: {
rule: "block",
message: "This email address could not be verified. Check spelling and retry."
}
},
};
d.addEventListener("DOMContentLoaded",function(){if(d.querySelector(conf.addressSelector)){var e=d.createElement("script");e.src="https://api.addressfinder.io/assets/email/v2/widget.js",e.async=!0,e.onload=function(){new AddressfinderEmail.Email.Widget(conf.addressSelector, conf.licenceKey, conf)},d.body.appendChild(e)}});
})(document);
</script>
Email verification integration methods:
-
Email Verification widget - for custom wesbites or CRMs, highly configurable
-
Email Verification API - advanced integration for direct calls from a server or application
-
Bulk Email Verification - verify large numbers of emails easily through the Addressfinder portal