Auto assign user to group by email extension
-
mattie44
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
10 years 3 weeks ago #3268
by mattie44
Hi there, I want to auto assign all "@gmail.com" users to a specific group called email. I can auto assign a user based on their full email entered in the email field but I cant seem to auto assign a user based specifically on their email extension i.e. "@gmail.com" to a group. Is this possible?
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 3 weeks ago - 10 years 3 weeks ago #3273
by admin
Hi,
at the moment the plugin compares the field value with the list of specified values, the partial match is not supported. You should modify a little the php code to get this.
In the function checkFieldValues change the lines:
$key = array_search($current_value, $required_list);
if ($key !== false)
With:
$key = array_filter($required_list, function($el) use ($current_value) {
return ( strpos($current_value, $el) !== false );
});
if (count($key) > 0)
Not tested but should work...
Kind regards,
Luigi
Last edit: 10 years 3 weeks ago by admin.
The following user(s) said Thank You: mattie44
Please Log in or Create an account to join the conversation.
-
mattie44
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
10 years 3 weeks ago #3275
by mattie44
Okay I replaced the code. Still no luck , not sure how to set my parameters in the auto group plug for the email field? This is what they look like " email;@gmail.com;email;true " using the full email address works but i just want the email domain to be captured and autogrouped!
Please Log in or Create an account to join the conversation.
-
mattie44
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
10 years 3 weeks ago #3276
by mattie44
Okay sorry my apologies its working perfectly, thank you so much =)
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.165 seconds