Everest Forms Documentation

Step by step documentation to set up a form for your website.

How to white list domains for email?

Whitelisting email helps to prevent junk/spam emails. Only trusted domains can be allowed to send emails. Or, you can block the untrusted email domains from sending the email. Whitelisting leads to improved deliverability. Also, using this feature your emails will land in your inbox every time.
Now, in order to enable this feature, you need to go to the email field options in your form builder.

Here, on the left, you can see the field options for the email field. Scroll down the options to find ‘Advanced Settings’. Now, inside this setting. you will find the section called ‘Whitelisted Domains’. There are two options available in the whitelisted domain section. They are:

  • Allowed Domains: When you select this option, you can enter the domain names for example, gmail.com, etc, and only the emails from these domains will be sent to the users.
  • Denied Domains: When you select this option, you can enter the domain names for example, gmail.com, etc, and the emails from these domains will not be sent to the users.
When you choose Allowed Domains, the domain listed below this option will be allowed. You will have to add domains seperately for Denied Domain by choosing the Denied Domains option

What happens when a user tries to enter a domain name that is not allowed?

Whenever a domain name that is not allowed is entered in the email field, the form is not submitted and throws an error just like in the image below.

Block a particular Email Address #

If you want to block a particular email address, you will need to add the following code to your theme’s functions.php file.

add_action('everest_forms_process_validate_email', 'email_validate', 10, 3);
function email_validate($field_id, $field_submit, $form_data)
{
if (is_array($field_submit) ) {
$value = ! empty($field_submit['primary']) ? $field_submit['primary'] : '';
} else {
$value = ! empty($field_submit) ? $field_submit : '';
}
$block_email = array('[email protected]', '[email protected]');
if (in_array($value, $block_email, true)) {
evf()->task->errors[ $form_data['id'] ][ $field_id ] = ('Sorry you cannot submit the form');
update_option('evf_validation_error', 'yes');
}
}
Check this out to add custom code on your website.

Powered by BetterDocs

Scroll to top