Guest User

Untitled

a guest
Nov 18th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. { "rules_notify_users_about_new_comment" : {
  2. "LABEL" : "Notify users about new comment",
  3. "PLUGIN" : "reaction rule",
  4. "OWNER" : "rules",
  5. "REQUIRES" : [ "rules", "rules_conditional", "comment" ],
  6. "ON" : { "comment_insert" : [] },
  7. "DO" : [
  8. { "variable_add" : {
  9. "USING" : { "type" : "listu003Cuseru003E" },
  10. "PROVIDE" : { "variable_added" : { "users_to_notify" : "Users to notify" } }
  11. }
  12. },
  13. { "LOOP" : {
  14. "USING" : { "list" : [ "comment:node:comments" ] },
  15. "ITEM" : { "current_comment_item" : "Current comment item" },
  16. "DO" : [
  17. { "CONDITIONAL" : [
  18. {
  19. "IF" : { "NOT data_is" : {
  20. "data" : [ "current-comment-item:author" ],
  21. "value" : [ "comment:author" ]
  22. }
  23. },
  24. "DO" : [
  25. { "list_add" : {
  26. "list" : [ "users-to-notify" ],
  27. "item" : [ "current-comment-item:author" ],
  28. "unique" : "1"
  29. }
  30. }
  31. ]
  32. }
  33. ]
  34. }
  35. ]
  36. }
  37. },
  38. { "CONDITIONAL" : [
  39. {
  40. "IF" : { "NOT data_is" : { "data" : [ "comment:author" ], "value" : [ "comment:node:author" ] } },
  41. "DO" : [
  42. { "list_add" : {
  43. "list" : [ "users-to-notify" ],
  44. "item" : [ "comment:node:author" ],
  45. "unique" : "1"
  46. }
  47. }
  48. ]
  49. }
  50. ]
  51. },
  52. { "LOOP" : {
  53. "USING" : { "list" : [ "users-to-notify" ] },
  54. "ITEM" : { "current_user_to_notify" : "Current user to notify" },
  55. "DO" : [
  56. { "mail" : {
  57. "to" : [ "current-user-to-notify:mail" ],
  58. "subject" : "New comment to node with id [comment:node:nid]",
  59. "message" : "There is a new comment added to the node with id [comment:node:nid]",
  60. "language" : [ "" ]
  61. }
  62. }
  63. ]
  64. }
  65. }
  66. ]
  67. }
  68. }
Add Comment
Please, Sign In to add comment