Yuniar,
A "quick" question; is there a fast way to block email accounts like @hotmail.com, @msn.com, @gmail.com, @live.nl, etc. from the email field?
Our company does not accept orders from those emailaccounts.
Please advice... Thanks in advance!
Yuniar,
A "quick" question; is there a fast way to block email accounts like @hotmail.com, @msn.com, @gmail.com, @live.nl, etc. from the email field?
Our company does not accept orders from those emailaccounts.
Please advice... Thanks in advance!
Oh and if it's possible only for specific forms, so we can still use, for example, Hotmail accounts on some forms (e.g. migration forms).
Currently we have about 14 active forms. However from form 1 through 11 it's not allowed to use free emailaccounts like Hotmail and Gmail, but on forms 12 through 14 it is allowed to use these.
Hopefully I made myself clear! Thank you.
Hi,
In this case you should add another validation to block those e-mails. Open your "includes/common-validator.php" and add those code on line 28.
//validation for email address
function validate_blacklist_mail($value){
//define blocked email address
$block_email_list = '@test.com,@wow.com';
$blacklisted_mail = explode(',',strtolower($block_email_list));
if(in_array(strstr($value[0],'@'),$blacklisted_mail)){
return 'This email not allowed';
} else {
return true;
}
}
in there I assume you want to block e-mail from test.com and wow.com. After that edit your "includes/post-functions.php" and search on line 289, you'll find this code :
$rules[$element_name]['email'] = true;
add exactly below that code to activate the validation:
$rules[$element_name]['email'] = true;
if ($form_id == '11') {
$rules[$element_name]['blacklist_mail'] = true;
}
Finnaly it also filter the validation only for form 11 :).
Okay thanks!! You are a life-saver. :)
I will give it a go!
yes they will get 'This email not allowed', to add custom message simply change those message.
return 'This email not allowed';Works great! Thanks! :)
//edit
Yeah I overlooked the message part, my bad! :)
You must log in to post.