Hi @jpgoem
Hope this message finds you well.
Currently, there is no option to customize the email validation, however, our developers coded a snippet to check a list of forbidden domains:
add_filter( 'forminator_custom_form_submit_errors', function( $submit_errors, $form_id, $field_data_array ){
$email_field = 'email-1';
$forbitten_public_emails = array( 'gmail', 'yahoo' );
$email = isset( $_POST[ $email_field ] ) ? $_POST[ $email_field ] : false;
if ( ! $email ) {
return $submit_errors;
}
list( $user, $domain ) = explode( '@', $email );
foreach ( $forbitten_public_emails as $forbitten_public_email ) {
if ( strpos( $domain, $forbitten_public_email ) !== false ) {
$submit_errors[][ $email_field ] = __( 'Please avoid using gmail, yahoo etc and use a private email instead' );
break;
}
}
return $submit_errors
You will need to update these lines:
$forbitten_public_emails = array( 'gmail', 'yahoo' );
Replace gmail, yahoo, with the domains you want to block or verify.
$email_field = ’email-1′;
Replace the email-1 with your form email field tag.
You might need to install it as a mu-plugin following the instructions on this link https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins.
Best regards,
Laura