Rules Mastery 19 -- Points to spam reporters (solution)
Channel: Johan Falk
Date: 2012-03-05

Here is how you can reward people who mark comments as spam, but *only when the comment is deleted* (to avoid people marking everything and anything as spam).
* Add a new reaction rule, reacting on the event 'after deleting a comment'.
* Add the action 'fetch users who have flagged a comment' (and select the spam flag for the deleted comment). This will load a *list* of all the users who have marked the relevant comment as spam. Give the 'current list item' a relevant name, such as 'reporting user'.
* Add a loop, looping through all the users in the list.
* For each user, call the 'award Drupal points' component and give one Drupal point.
* Done!

Bonus: Create another rule that unpublishes the comment when the third spam flag is set.

(This video is a part of the training found at http://denver2012.drupal.org/content/rules-mastery.)