I want to private message a user if when creating a node they selected "cars" as the node's category. How can this be done?

Comments

tr’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
Issue summary: View changes
Status: Active » Fixed

This is an export of a Rule that worked for me. Import it and edit it to suit your needs.
field_tags is the field used to hold the node's taxonomy term, and 5 is the term id I'm checking for - you will want to change that to be the term id for your 'cars' term. This Rule displays a system message, but you can use a send mail action instead. It's easier to debug with a system message, so use this to get it working first.

{ "rules_check_taxonomy_term" : {
    "LABEL" : "Check Taxonomy Term",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "node_insert" : [], "node_update" : [] },
    "IF" : [
      { "entity_has_field" : { "entity" : [ "node" ], "field" : "field_tags" } },
      { "list_contains" : { "list" : [ "node:field-tags" ], "item" : "5" } }
    ],
    "DO" : [
      { "drupal_message" : { "message" : "A node containing the tag [node:field_tags] just got created or updated." } }
    ]
  }
}

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.