Skip to main content

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

ParameterTypeDescriptionExample
addressSelectorStringCSS selector for one or more input elements.input.email
licence_keyStringYour unique licence key.VYT6FHV6TPQEWNBG4K7Q
optionsObjectConfiguration options, see the Options section below.{"rules": {"unverified": "block", "message": "Email address cannot be verified. Check spelling and retry"}}

Methods

MethodParameterReturn valueDescription
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

KeyTypeDescriptionDefault
rules.unverified.ruleStringRule for unverified email addresses: block, warn or allowblock
rules.unverified.messageStringMessage 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.ruleStringRule for disposable email addresses: block, warn or allow. For example, test.account@mailinator.com is a disposable email address.block
rules.disposable.messageStringMessage to display to the user when a disposable email address is detected.Disposable email addresses are not permitted.
rules.role.ruleStringRule for role email addresses: block, warn or allow. For example, accounts@topshop.com.au is a role email address.allow
rules.role.messageStringMessage to display to the user when a role email address is detected.-
rules.public.ruleStringRule for public email addresses: block, warn or allowallow
rules.public.messageStringMessage to display to the user when a public email address is detected.-
checkStringControls 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
providerBooleanRequests that the base domain of underlying email service provider is returned in the response.false
containerDOM elementElement into which the loading indicators and error messages are injected.-

Events

EventsCallback argumentsDescription
result:verifiedmetadata:ObjectFired 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_verifiedmetadata:ObjectFired 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

See email verification metadata.