Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "rules_notify_users_about_new_comment" : {
- "LABEL" : "Notify users about new comment",
- "PLUGIN" : "reaction rule",
- "OWNER" : "rules",
- "REQUIRES" : [ "rules", "rules_conditional", "comment" ],
- "ON" : { "comment_insert" : [] },
- "DO" : [
- { "variable_add" : {
- "USING" : { "type" : "listu003Cuseru003E" },
- "PROVIDE" : { "variable_added" : { "users_to_notify" : "Users to notify" } }
- }
- },
- { "LOOP" : {
- "USING" : { "list" : [ "comment:node:comments" ] },
- "ITEM" : { "current_comment_item" : "Current comment item" },
- "DO" : [
- { "CONDITIONAL" : [
- {
- "IF" : { "NOT data_is" : {
- "data" : [ "current-comment-item:author" ],
- "value" : [ "comment:author" ]
- }
- },
- "DO" : [
- { "list_add" : {
- "list" : [ "users-to-notify" ],
- "item" : [ "current-comment-item:author" ],
- "unique" : "1"
- }
- }
- ]
- }
- ]
- }
- ]
- }
- },
- { "CONDITIONAL" : [
- {
- "IF" : { "NOT data_is" : { "data" : [ "comment:author" ], "value" : [ "comment:node:author" ] } },
- "DO" : [
- { "list_add" : {
- "list" : [ "users-to-notify" ],
- "item" : [ "comment:node:author" ],
- "unique" : "1"
- }
- }
- ]
- }
- ]
- },
- { "LOOP" : {
- "USING" : { "list" : [ "users-to-notify" ] },
- "ITEM" : { "current_user_to_notify" : "Current user to notify" },
- "DO" : [
- { "mail" : {
- "to" : [ "current-user-to-notify:mail" ],
- "subject" : "New comment to node with id [comment:node:nid]",
- "message" : "There is a new comment added to the node with id [comment:node:nid]",
- "language" : [ "" ]
- }
- }
- ]
- }
- }
- ]
- }
- }
Add Comment
Please, Sign In to add comment