Send email to all users that are tagged with the same tag a node is when created There is a lot of similar questions here but I am having a hard time wrapping my head around this.

I have a taxonomy term reference field called field_category. This field is available on user/*/edit and on node/add.

Category


1
2
3


What I would like to do is send an email when a node is created that has the same taxonomy term(s) that a user has specified in their profile.

I have tried to wrap my head around using the rules and view_rules module but every configuration I have tried fails.

Can anyone provide me with some direction? Thanks!

Drupal 7.65

Rules: 7.x-2.12

Views Rules 7.x-1.0

Edit

Using pinueve answer, here is where I am at. The actions/conditions section of his answer is still unclear to me. My holdup is trying to match his example in the actions section. 



{ "rules_area_of_expertise" : {
    "LABEL" : "area of expertise",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "mail" ],
    "REQUIRES" : [ "rules", "rules_conditional" ],
    "ON" : { "node_insert--answers_question" : { "bundle" : "answers_question" } },
    "IF" : [
      { "entity_has_field" : { "entity" : [ "node" ], "field" : "field_category" } }
    ],
    "DO" : [
      { "CONDITIONAL" : [
          {
            "IF" : { "entity_has_field" : { "entity" : [ "node" ], "field" : "field_category" } },
            "DO" : []
          }
        ]
      }
    ]
  }
}
install: views-rules-module, and rules-conditional module. Add in views a rules-view (is a new display type added by rules-view-module) of type USERS, add your category-field, hide from display, add relationship to taxonomy-vocabulary, add field: term-ID and UID. Both fields in views middle column set your fields as type: INTEGER. If you want you can delete user-field_category from this view. If needed, filter users by role or whatever to shorthen your view results, and important: no-pager, display all rows.

Now in rules: react-on: new content of type: your-content-type, conditions: entity-has-field: node-created-content: your field_category, actions: fetch-entity-by-id: taxnomony-term: value: drill in node until you find node-term-ID.

Add your new view-rule (find link at bottom settings in actions), now you have term-ID from user &amp; UID, inside view-loop and a conditional, add an if, data-comparision, your NODE-term-ID vs USER-term-id, if equal, fecth USER by ID, with your variable UID, and send email. Done.
Note: is possible that you will need to transform your NODE-term-ID as an integer.

Your rule will look like something like this: 

EDIT: first install rules Version: 7.x-2.11, i can see that you do not see 'conditional label' in rules action. To avoid to update rules module, install disable-updates-module

FIRST action should be 'fetch entity bt ID: tanonomy term', select your new node, and drill until you find term-ID.

SECOND action: add your users-views-rule. all following actionts take place inside rules-view-loop.

THRID action: inside rules view, data compare: your variable term-id from rules-view-users with NODE-term-ID (first action), if values match (are equal) then fetch USER by ID with your variable value UID from rules-view, now you have user object avilable, do send email to that user, rules-view will compare next user, and so on. here is another img of how will look your rule, notice how actions are taking place inside rules-view-loop.



and here is an img where you can find how to add your rules-view, it says "Add a view loop" at the bootom of img.



And this is how you set your fields inside rules-view, this is located in middle colum of your view.