Here is a rule (in Rules export format) that can be used to send an email to the node author after the node is unpublished:
{ "rules_send_email_after_node_is_unpublished" : {
"LABEL" : "Send email after node is unpublished",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_update" : [] },
"IF" : [
{ "data_is" : { "data" : [ "node-unchanged:status" ], "value" : "1" } },
{ "data_is" : { "data" : [ "node:status" ], "value" : "0" } },
{ "NOT data_is" : {
"data" : [ "node-unchanged:author:uid" ],
"value" : [ "site:current-user:uid" ]
}
}
],
"DO" : [
{ "mail" : {
"to" : [ "node-unchanged:author:mail" ],
"subject" : "Your content is unpublished ...",
"message" : "This is to inform you that your node (with node id = [node-unchanged:nid] and node title = [node-unchanged:title]) has been unplublished ...",
"language" : [ "" ]
}
}
]
}
}
If you have the Rules UI enabled, you should be able to import the above rule in your own site.
Some more details about this rule:
- Rules Event: After updating existing content
- Rules Conditions (all of them must be TRUE):
- Before the update, the node must be Published.
- After the update, the node must be Unpublished.
- The user performing the update must not be the author of the node (otherwise the eMail is useless, no need to send such eMail to yourself).
- Rules Action: Send an appropriate eMail (adapt its content to fit your needs).
Obviously, you could add other Rules Conditions (eg to check the role of the user performing the update), but at its core this rule will get the job done.