Exclude personal emails from pipedrive forms

Hello everyone,

I’m desperately looking for a way to exclude personal emails from my pipedrive form (I get a lot of fake forms or people looking for work). On my old form I was using simple javascript which excluded the selected emails and on the other hand allowed me to use a regex to check the integrity of the emails. Here is my code:

</script>
	<?php
}
function block_gmail_addresses() {
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function($) {
                $(".elementor-form").submit(function(e) {
                    var inputs = document.querySelectorAll('input');
                    inputs.forEach(function(input, index){
                        if (input.value.indexOf("@gmail.com") !== -1 || input.value.indexOf("@yopmail.com") !== -1 || input.value.indexOf("@yopmail.fr") !== -1 || input.value.indexOf("@orange.fr") !== -1 || input.value.indexOf("@wanadoo.fr") !== -1 || input.value.indexOf("@hotmail.fr") !== -1 || input.value.indexOf("@hotmail.com") !== -1 || input.value.indexOf("@outlook.fr") !== -1 || input.value.indexOf("@free.fr") !== -1 || input.value.indexOf("@aol.com") !== -1 ||  input.value.indexOf("@sfr.fr") !== -1  || input.value.indexOf("@neuf.fr") !== -1 || input.value.indexOf("@msn.fr") !== -1 || input.value.indexOf("@laposte.net") !== -1  || input.value.indexOf("@msn.com") !== -1 || input.value.indexOf("@outlook.com") !== -1 || input.value.indexOf("@icloud.com") !== -1) {
                            input.value = '';
                            alert("Les adresses personnelles ne sont pas autorisées. Veuillez utiliser une adresse professionnelle.");
                            e.preventDefault();
                            return false;
                        }
                    })
					
					//vérification email pour formulaires
					const emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
					const emailInputs = document.querySelectorAll("input[placeholder='Email*']");
					console.log(emailInputs);
					
					if (emailInputs) {
						emailInputs.forEach(emailInput => {
							if (!emailRegex.test(emailInput.value) && emailInput.value != '') {
							console.log(emailInput.value);
							emailInput.value = '';
							alert("L'adresse email saisie n'est pas valide. Veuillez saisir une adresse email professionnelle valide.");
							e.preventDefault();
							return false;
						}
						})
						
					}
                });
				
				
				
				

            });
        </script>

We use Wordpress with Elementor to integrate the form.

Do you have a solution so I can block personnal emails and just keep the professionnal ones ?

Thanks

Up please, I really need help for this case… It’s pretty anoying. Any solution ?

Hi,

The easiest solution would be to add a reCAPTCHA key in the Elementor settings on WordPress and include the required settings in your form.

They also have a blog about it: ReCAPTCHA & Elementor Integration » Elementor

Let me know if this fixes your problem.

Willing to help you out as well if you can’t get it fixed yourself.

Kind regards,

Michel

I’m well aware of this technique, which we already use. The problem is that I need to sort through the email directly to refuse personal emails. The people who contact us that I want to refuse are real people (looking for work or whatever), so I don’t have to worry about spam…

I see, thank you for specifying the problem further. Perhaps using Pipedrive Automations or a Pipedrive Webhook to check for said pattern, and removing where the condition matches could work for you. I think your best bet might be using Webhooks. This does require quite a bit of setting up, though.

How often does this occur? Sounds like this shouldn’t happen too frequently, and simply removing the lead could also suffice. Some companies also use regular email domains as their business email, and said logic would block these senders as well.

Kind Regards,

Michel

Thank you for your prompt reply.

We already use pipedrive automation, as soon as leads register they enter an email workflow if they haven’t scheduled an appointment.

This happens very often, we have between 2 and 6 false requests a day, which is why I need to filter them because it takes time.

So if I understand your script correctly, you want to remove leads that match a certain e-mail adres domain. You could achieve this by an automation in Pipedrive. It is in Dutch, so i’ll translate:

  1. Trigger ⇾ “Lead created”
  2. Condition ⇾ e-mail contact person (or whatever field you want) ends with @yahoo.com or @outlook.com
  3. Action ⇾ Delete said lead. (or perhaps add a label/move to other pipeline)

I haven’t found a way to validate the emails using Regex. For this part, you would have to implement a Webhook on the Lead endpoint and apply the custom logic here. But I think automations can get you quite far with a small investment of your time.

As said, we’re willing to help you with any custom logic.

Kind Regards,

Michel

The problem is that I get confirmation emails in my mailbox no matter what. I can use this technique to delete the contact on pipedrive, but the problem I have is that I want to completely block the form from the moment the lead clicks on “send form” so that I don’t receive a confirmation email or create a contact record on pipedrive. Hence the need for my regex.

The solution would be for me to modify the form code, but that’s obviously impossible.

Ah, yes, that does make things a bit harder. You could completely disable e-mail notifications, and send custom emails for where the condition is not true (as compared to the blocking leads automation), but that is quite tedious to maintain. Also, I’m not sure if disabling e-mail notifications also works for e-mails sent for forms. That is something you would need to try out.

The problem with this technique is that I won’t receive the appointment requests, but the slots in our diaries will still be blocked.

Isn’t there a solution so that I can put my REGEX on the pipedrive form directly?

This topic was automatically closed after 30 days. New replies are no longer allowed.