How to use Rules for sending an email to all users with same field value in some select list? When users registers on my site, they choose their State of Origin.

Using Rules I would like to configure a rule which sends an email to all users from the same state when a user from that state edits his/her profile.

Is this possible using Rules or is there another approach?
Without knowing anything about your entity &amp; field setup I can't give you an exact rules that will work however it is possible and I can give you a pseudo rule:


Install the rules bonus pack module.
Install the rules conditional module (I think you need this but I'm not actually looking at a site to confirm).
Create a view that lists all users with a contextual filter of the state field. - So when you call the view with a specific state you get all users who have selected that state.
Event: Before user profile is saved.
Action: Rules bonus pack action "Load a user list with Views". Use the user email list view from earlier and pass in the value of the state from the new user object (from after the edit).
Action: Loop through the user list you loaded from the view.
Action: In the user list loop send an email to the loop user object.


This will also send an email to the user who is actually changing their profile. if you want to exclude them you can either add more conditions in the rule to check against the edited user object or you can add another contextual filter to the view for uid, check the box in that contextual field to exclude that user from the results and then also pass in the uid as a contextual filter in the rule.

I would do that latter because it is a less complex rule and I would assume it would use less resources to run.