Scheduled Rules, User Inactivity Notification based on Field contents

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
biggm's picture

Goal: to create a scheduled rule which notifies users who have not commented recently.

I've exhausted all existing rules documentation, including the full learning library at NodeOne. I would really appreciate some help.

I've included full exports of both components.

Outline of the process:
Cron runs rules_user_variable_grab
it sets a date variable and loops through a user list variable. On each loop a separate rule (User Activity Check) does a data comparison of the user data and sees if 5 days have passed since they commented.

For the sake of testing, I've made it so the condition would always pass and it would send me an email for each user. In short, it doesn't. The rules debug log is clean, but it doesn't show that it's executing the rule in the loop (User Activity Check)

Finally, when I run the components individually, they are executing. I think there's a problem in my user list var and loop, but I don't know for sure.

Any help would extremely appreciated. Exports below:


{ "rules_user_variable_grab" : {
"LABEL" : "User Variable Grab",
"PLUGIN" : "rule set",
"REQUIRES" : [ "rules" ],
"RULES" : [
{ "RULE" : {
"PROVIDE" : { "variable_added" : {
"date_variable_active" : "Date variable active",
"user_array_active" : "User Array"
}
},
"DO" : [
{ "variable_add" : {
"USING" : { "type" : "date", "value" : "now" },
"PROVIDE" : { "variable_added" : { "date_variable_active" : "Date variable active" } }
}
},
{ "variable_add" : {
"USING" : { "type" : "list\u003Cuser\u003E" },
"PROVIDE" : { "variable_added" : { "user_array_active" : "User Array" } }
}
},
{ "LOOP" : {
"USING" : { "list" : [ "user-array-active" ] },
"ITEM" : { "user_var" : "User Var " },
"DO" : [
{ "mail" : {
"to" : "mike@callcbd.com",
"subject" : "[user-var:field-name]",
"message" : "Test",
"from" : "no-reply@diverge.us"
}
},
{ "component_rules_user_activity_rule" : { "user_variable" : [ "user-var" ] } }
]
}
}
],
"LABEL" : "User Variable Grab"
}
}
]
}

}

{ "rules_user_activity_check" : {
"LABEL" : "User Activity Check",
"PLUGIN" : "rule set",
"REQUIRES" : [ "rules" ],
"USES VARIABLES" : {
"date_variable" : { "label" : "Date Variable", "type" : "date" },
"user_variable" : { "label" : "User Variable", "type" : "user" }
},
"RULES" : [
{ "RULE" : {
"IF" : [
{ "data_is" : {
"data" : [ "site:current-date" ],
"op" : "\u003E",
"value" : [ "user-variable:field-lastcommentdate:value" ]
}
}
],
"DO" : [
{ "mail" : {
"to" : "mike@callcbd.com",
"subject" : "[user-variable:field-name], we want your opinion!",
"message" : "We haven\u0027t heard from you in a while. Our community wants input from members like you.\r\nContribute here: [site:login-link]",
"from" : "DIVERGE \u003Cno-reply@diverge.us\u003E"
}
}
],
"LABEL" : "Comment Activity Check"
}
}
]
}

}

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: