Check lead email domain on form if lead is known before executing custom HTML | Community
Skip to main content
June 14, 2017
Solved

Check lead email domain on form if lead is known before executing custom HTML

  • June 14, 2017
  • 1 reply
  • 2918 views

Greetings,

I am creating a 2 step verification, step one check if the lead is known, step 2 If the lead is known then check if their email address is from an accepted domain eg only leads from the domain marketo.com are allowed to proceed.

I started by creating a verification landing page, I created a form and hid the submit button, created a rich text field and set an error message (for unknown and non accepted domain leads). Then in the form settings I selected 'If lead is known' option and in the custom HTML, put a page redirect to the landing page known leads are able to access via a redirect script

<script>

window.location.href = "mydomain.com/welcome.html";

</script>

My question how do I also check if the known lead is from the accepted domain marketo.com only (via checking the lead's email address) before redirecting them to the welcome page? (my ideal solution)

Second option would be when the form recognises the lead as a 'known lead' it will execute the custom HTML, load the welcome page if your domain is accepted,otherwise load another page say "http://www.mydomain.com/notwelcome.html"​ instead.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Typo, check your console...

1 reply

SanfordWhiteman
New Participant
June 14, 2017

To check the known lead's domain in this scenario -- assuming this is a Marketo LP with PreFill enabled -- check the (global) JS variable

     mktoPreFillFields.Email

June 14, 2017

Would the check be performed in the custom HTML in the form before the redirect?

SanfordWhiteman
New Participant
June 14, 2017

Yep.