validation for customer email domain

validation for customer email domain

edenis
Shopify Partner
2 0 0

I want to add validation for customer email domain in my javascript frontend code like the validtion there is in the checkout page for the customer email domain. how can i get this function? there is api?

Replies 3 (3)

TheScriptFlow_
Shopify Partner
848 63 106

This topic has already been discussed before on the Shopify community. If you could spend your valuable time on this conversation, then I believe you can get an answer.

https://community.shopify.com/c/shopify-scripts/customer-registration-form-using-specific-email-doma...

If you don't find your answer, then get back to me. I would like to guide you further.

- Need a Shopify Specialist? Chat on WhatsApp +923036471248 Or Email at info@thescriptflow.com

- Boost Your Sales with Affiliate Marketing - UpPromote: Affiliate & Referral


- If my solution was helpful, mark it as a solution and hit the like button!

edenis
Shopify Partner
2 0 0

Thanks for the reply, I read the answer but I don't want to use a specific pattern.

I want the logic like on the checkout page that checks for every domain that can be given to it whether it is a real domain or not!  

Is this possible?

TheScriptFlow_
Shopify Partner
848 63 106

Based on my research, unfortunately, Shopify doesn't provide a direct API for accessing their internal email domain validation logic that's used in the checkout. However, I can help with a third-party service, DeBounce Integration by integrating the DeBounce into your Shopify forms API and adding your domain to the approved domain lists.

Here is the detailed info: https://debounce.io/integrations/shopify/
You can explore this code for further info.

async function validateEmailWithAPI(email) {
  try {
    const response = await fetch(`https://api.debounce.io/v1/?api=${YOUR_API_KEY}&email=${email}`);
    const result = await response.json();
    return result.debounce.result === 'Safe';
  } catch (error) {
    console.error('Email validation error:', error);
    return false;
  }
}

I hope this could helps.

- Need a Shopify Specialist? Chat on WhatsApp +923036471248 Or Email at info@thescriptflow.com

- Boost Your Sales with Affiliate Marketing - UpPromote: Affiliate & Referral


- If my solution was helpful, mark it as a solution and hit the like button!