title: How to validate email address in Wordpress with Ninja Form plugin
body: <p>I'm trying to find a solution to only validate emails with .edu extension in Wordpress using Ninja Forms plugin.</p>
  
  <p>With Contact Form 7 I can something like this:</p>
  
  <pre><code>function is_edu($email) {  
    if(substr($email, -4) == '.edu') {  
         return true;  
    } else {  
         return false;  
    };  
  };  
  function custom_email_validation_filter($result, $tag) {  
    $type = $tag['type'];  
    $name = $tag['name'];  
    if($name == 'your-email') { // Only apply to fields with the form field name of "your-email"  
         $the_value = $_POST[$name];  
         if(!is_edu($the_value)){  
              $result['valid'] = false;  
              $result['reason'][$name] = 'This is not a .edu address!'; // Error message  
         };  
    };  
     return $result;  
  };  
  add_filter('wpcf7_validate_email','custom_email_validation_filter', 10, 2); // Email field  
  add_filter('wpcf7_validate_email*', 'custom_email_validation_filter', 10, 2); // Required Email field 
  </code></pre>