1

I have an issue on production site that I cannot reproduce.

The Rule below should trigger an email if the new content is published. But emails are being send even if content is not published.

{ "rules_content_new" : {
  "LABEL" : "Notify new content",
  "PLUGIN" : "reaction rule",
  "OWNER" : "rules",
  "REQUIRES" : [ "rules" ],
  "ON" : { "node_insert--article" : { "bundle" : "article" } },
  "IF" : [
  { "data_is" : { "data" : [ "node:status" ], "value" : "1" } },
  { "data_is" : { "data" : [ "node:field-custom" ], "value" : "13" } }
  ],
  "DO" : [
  { "mail" : {
  "to" : "[email protected]",
  "bcc" : "[site:full-mailing-list]",
  "subject" : "[node:title]",
  "message" : "new content available",
  "from" : "[email protected]",
  "language" : [ "" ]
  }
  }
  ]
  }
 }

1 Answer 1

1

From official Rules documentation:

By default, Rules assumes AND operators between conditions (if no OR group is explicitly used).

Syntactically there is nothing wrong with your rule.

A little tip for troubleshooting this rule (because obviously that rule does not give you any error messages) - add action "Show a message on the site" and output values from your conditions in that message. If the values shown are correct but the rule still malfunctions - try deleting it and then recreate it.

Also, you can try using Rules condition "Content is published" instead of checking the value of node:status. It is basically the same thing, but maybe in your situation will give a different result.

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.