Sorry, that title feels spammy in itself lol but I couldnt find a solution to this anywhere for formit specifically and, to my amazement, I was able to create one!!! Yay me! Lol although I am sure someone can refine my php even simpler but anyways... Hopefully that title is very search friendly on here.
I am a designer/developer and my customers get legitimate companies who try and sell them their services though their website's contact forms especially for SEO, website traffic blah blah blah. Well, I figured there had to be a simple solution to check for words in the message field and either give a false confirmation and not submit the form or, as this solution does, simply do nothing which in most cases will meet my need since they'll probably just move on robot or person alike... (again I am sure someone can improve upon this)
So basically I added a few things together and came up with this custom hook which I hope is helpful to someone else as well.
1. I created a snippet called scumwords (so as to not be confused with badwords for eforms I believe it is)
with the php as seen here:
$message = $hook->getValue('message');
if (strpos($message, 'website') !== false) {
return false;
}elseif (strpos($message, 'traffic') !== false) {
return false;
}else{
return true;
}
2. Update the words "traffic" and "website" with your words.
3. Added custom hook name "scumwords" into the hooks field, which I put it after spam, like this:
&hooks=`spam,scumwords,email,FormItSaveForm`
And viola! Those emails get ignored with spammers not really sure what is going on and all other emails go through like normal.
What do yall think?! Again, I hope it helps someone else!