AddressfinderEmail.Email.Widget class
This widget adds email verification to a simple form field. It will check that the email address is valid and meets the configured criteria. If unverified, a cross icon and an error message are displayed. A verified email address is identified with a simple tick icon.
You can choose from block
, warn
or allow
behaviour for each of the
four types of email addresses. These include:
- Disposable emails, such as testing@mailinator.com
- Role addresses. These are typically group email addresses, such as accounts@business.com.au
- Public addresses with common email brands such as Gmail, BigPond, etc.
- Unverified addresses.
More information about how to configure these options and changing the visual styles can be found on the advanced options page. The code examples page demonstrates many of these configuration options.
Constructor
Parameter | Type | Description | Example |
---|---|---|---|
addressSelector |
String |
CSS selector for one or more input elements. | input.email |
licence_key |
String |
Your unique licence key (find on Portal credentials) | VYT6FHV6TPQEWNBG4K7Q |
options |
Object |
Configuration options, see the Options section below. |
{"rules": {"unverified": "block", "message": "Email address cannot be verified. Check spelling and retry"}}
|
Methods
Method | Parameters | Return Value | Description |
---|---|---|---|
disable() |
Disables the Addressfinder email widget. The verification function will stop working until the widget is re-enabled. | ||
enable() |
Re-enables a disabled Addressfinder email widget. | ||
reactivate() |
Executes the verification function on the input value. The Addressfinder email widget must be enabled. |
Options
Key | Type | Description | Default |
---|---|---|---|
rules.unverified.rule |
String |
Rule for unverified email addresses: block , warn or allow |
block |
rules.unverified.message |
String |
Message to display to the user when an unverified email address is detected. | This email address could not be verified. Check spelling and retry. |
rules.disposable.rule |
String |
Rule for disposable email addresses: block , warn or allow .
For example, test.account@mailinator.com is a disposable email address.
|
block |
rules.disposable.message |
String |
Message to display to the user when a disposable email address is detected. | Disposable email addresses are not permitted. |
rules.role.rule |
String |
Rule for role email addresses: block , warn or allow .
For example, accounts@topshop.com.au is a role email address.
|
allow |
rules.role.message |
String |
Message to display to the user when a role email address is detected. | - |
rules.public.rule |
String |
Rule for public email addresses: block , warn or allow |
allow |
rules.public.message |
String |
Message to display to the user when a public email address is detected. | - |
check |
string |
Controls the methods of verification to be completed. domain is a check to verify that
the domain of the email address has the expected DNS records. connection is a check to verify
that the email account exists at the provided domain. This will impact the query processing time and data
returned in the response. Use a comma to separate multiple values.
|
domain,connection |
provider |
boolean |
Requests that the base domain of underlying email service provider is returned in the response. | false |
container |
DOM element |
Element into which the loading indicators and error messages are injected. |
Events
Event | Callback Arguments | Description |
---|---|---|
result:verified |
metadata:Object |
Fired when the widget receives a response from the API that aligns with the permissions (allow , warn , block ) defined in the widget's rules. e.g. Email is verified. |
result:not_verified |
metadata:Object |
Fired when the widget receives a response from the API that conflicts with the permissions (allow , warn , block ) defined in the widget's rules. e.g. Email is disposable. |
Metadata
Property | Type | Description | Example |
---|---|---|---|
success |
Boolean |
If the number did not verify, this will contain a short description of the failure reason. | true |
verified_email |
String |
The full verified email address. | jane.smith@addressfinder.com |
email_account |
String |
The first part of an email address, before the @ |
jane.smith |
email_domain |
String |
The second part of the email address, after the @ |
addressfinder.com |
is_verified |
Boolean |
We did not find any reason to believe an email sent to the address provided would fail to reach the associated mailbox. | true |
is_disposable |
Boolean |
Identified as a disposable email address. Learn more. | false |
is_role |
Boolean |
The email account is for a group email. For example info@addressfinder.com. | false |
is_public |
Boolean |
Identified as a public email provider. For example jane.smith@gmail.com. | false |
is_catch_all |
Boolean |
The email domain has a catch all policy. Learn more. | false |
not_verified_reason |
string |
If verified is false, this will contain a short description of the failure reason. | The email format is incorrect |
not_verified_code |
string |
A code indicating why the email did not verify. | FORMAT_INVALID |
email_provider_domain |
string |
The base domain of the underlying email service provider. Only populated when provider: true has been set. |
google.com |