I need to send notification on new comment to users. But not based on node ownership, but based on what Taxonomy term is selected in node. It might be good task to accomplish with Rules module.

So i knwo to set event - after saving a new content and Action - send e-mail

but for condition, i should somehow get the Commented node taxonomy term value. But cannot find selector: Taxonomy term to do data comparison, or way to get taxonmy data for given commented node. Is this possible ?

Can the commented node object be checked - if custom PHP is selected for condition - so i can check selected taxonomy term value ?


1 Answer 1


You should Load the Entity (node) from the comment's data.

Then pass that node to a component rule, which actually checks the taxonomy of the node and sends the appropriate email.

Here's a step by step.

First create a component: 1) Go to Rules -> Components -> Add new component 2) Select Rule 3) Name and Tag the component 4) In variables select 'Entity Node' and give it a label and a machine name. Example 'comment_node' 5) Add your conditions. Probably good idea to check node type and of course the taxonomy term you were looking for. 6) Add an Action. Here you should send an email.

Now go to your rule: 1) In actions add 'Fetch entity by Id'. Select 'node'. Use data selector and put 'comment:node:nid' in the id. 2) Then add a Loop 3) In the loop add an action. That action should be your component you created previously. 4) Pass the fetched entity into the component and you should be done

  • Thanks, but can you provide some details how to do it ? (Step by step if possible :) or critical step in detail )
    – NenadP
    Oct 28, 2012 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.