ZeroBounce is an alternate solution for real-time email verification. You may sign up for an account with ZeroBounce by going to their website https://www.zerobounce.net

STEP 1: Create Q&A or Form Node with Email field

STEP 2: Click the Add Scripts button

STEP 3: Enter the name of the script, select Script as the type and set it as an Enter event

STEP 4: Paste this code

<script>
  let emailField, submitBtn, buttonTxt, typingWaitTimer, previousValue, ipAddress, restoreTxt;

  const keyPressHandler = () => {
    if (!ipAddress) ipAddress = '{ip_address}';
    clearTimeout(restoreTxt);
    submitBtn.disabled = true;
    submitBtn.innerHTML = '<i class="fa fa-spin fa-spinner"></i> Verifying email...';
    let value = emailField.value;
    if (value != '' && value != previousValue) {
      clearTimeout(typingWaitTimer);
      typingWaitTimer = setTimeout(() => {
        !submitBtn.classList.contains('ng-hide') && checkEmail();
      }, 700);
    }
    previousValue = value;
  };

  const checkEmail = () => {
    const requestOptions = {
      method: 'POST',
      redirect: 'follow',
    };

    fetch(
      `https://api.zerobounce.net/v2/validate?api_key=yourapikey&email=${emailField.value}&ip_address=${ipAddress}`,
      requestOptions
    )
      .then((response) => response.json())
      .then((result) => {
        DT.setField('zerobounce_status', result.status);
        if (result.status === 'valid' || result.status === 'catch-all') {
          submitBtn.disabled = false;
          setTimeout(() => {
            submitBtn.innerHTML = '<i class="fa fa-check-circle"></i> Verified';
          }, 5);
          restoreTxt = setTimeout(() => {
            submitBtn.innerHTML = '<i class="fa fa-check-circle"></i> ' + buttonTxt;
          }, 2000);
        } else {
          submitBtn.disabled = true;
          setTimeout(() => {
            submitBtn.innerHTML = '<i class="fa fa-exclamation-circle"></i> Invalid Email';
          }, 5);
        }
      })
      .catch((error) => console.log('error', error));
  };

  setTimeout(() => {
    submitBtn = document.querySelector('button');
    buttonTxt = submitBtn.innerHTML;
    submitBtn.classList.add('ng-hide');

    emailField = document.querySelector('input[type=email]');
    emailField.addEventListener('keyup', keyPressHandler);
  }, 100);
</script>

STEP 5: Replace “yourapikey” with your own actual API Key from ZeroBounce

STEP 6: Save and Publish.

This completes your setup of ZeroBounce email verification.

Leave a Reply

Your email address will not be published.