Flag discussions to follow

Basic task As site member, I would like to be able to flag content that interests me, thereby getting e-mail notifications on new comments. It should also be possible to stop the comment subscription. This is important since it helps me follow and participate in discussions.

Bonus task As content contributor, I would like to automatically subscribe to comment notifications on the content that I write. This is important since I might forget to follow my own content, thereby missing important comments.

How to Demo: 

Note that while doing this exercise you can change all e-mail notifications to on-screen notifications, for easier development.

Basic task

  1. Log in to the site. (Use an account with an e-mail address you can access.)
  2. Find a piece of content. Verify that there is a link "Notify me of new comments". Click it.
  3. Verify that the link changes to "Stop comment notifications". (Don't click it.)
  4. Log out (or switch to a browser where you’re not logged in).
  5. Post a comment to the content above.
  6. Verify that the subscriber receives a notification within a few minutes.
  7. Log in to the site again (or switch back browser).
  8. At the content, click the "Stop comment notifications" link. Verify that it changes to "Notify me of new comments".
  9. Log out (or switch to a browser where you’re not logged in).
  10. Post a comment to the content above.
  11. Verify that the subscriber doesn't receive a notification within a few minutes.

Bonus task

  1. Log in to the site. (Use an account with an e-mail address you can access.)
  2. Post a piece of content.
  3. Verify that the link "Stop comment notifications" is present on the content page – not the "Notify me of new comments".
Required Preparations: 

A standard Drupal installation, plus the Rules and Flag modules.

Additional Comments: 
  • The features built in this exercise combines pretty bad with the previous exercises – you don't want multiple notifications on each comment. Building a list of notification recipients and making sure that noone gets two notifications is left as an exercise to the interested student. :-)
  • As frega pointed out to me, there is a risk that you kill your site if you have 1500 subscribers to a node's comment. It would be really cool if there was a way to wrap rules components to be executed by batch API or the job queue. Patches welcome!
Modules: 
Downloads: 
Solution Video: