My client has updated this site and now wishes to add a large number of approved email domains. Isn't there a way to do validation within Toolset, using Toolset logic? I need to be able to create a custom post type for Approved Domains, which the client can edit and maintain.
Then, I need to be able to redirect entries based on whether their email domain is one of these custom post types or not. It would certainly be great if there was a validation editor for forms, similar to that for views. Is there any way to obtain this functionality that would preclude writing any custom PHP functions?
Hello. Thank you for contacting the Toolset support.
My client has updated this site and now wishes to add a large number of approved email domains. Isn't there a way to do validation within Toolset, using Toolset logic? I need to be able to create a custom post type for Approved Domains, which the client can edit and maintain.
==>
Yes, you should create a custom post type for approved domains. You can do this with Toolset.
Then, I need to be able to redirect entries based on whether their email domain is one of these custom post types or not. It would certainly be great if there was a validation editor for forms, similar to that for views. Is there any way to obtain this functionality that would preclude writing any custom PHP functions?
===>
At this step you need to make a little change.
The following code needs to be changed that is I shared in previous ticket:
function validate_email_domain($email){
if (!preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]{2,})(\.[a-z]{2,4})$/i', $email)) return false;
$domains = array('gmail.com','yahoo.com','hotmail.com');
list(, $email_domain) = explode('@', $email, 2);
return !in_array($email_domain, $domains);
}
As you can see we are checking with static domains.