I am looking for a module or some kind of workaround e.g. involving Rules, that will allow anonymous users to subscribe to new comments on nodes they have created. My user scenario is as follows:

  1. An anonymous user wants to post a new forum topic
  2. She clicks on the “Add new forum topic” button
  3. On the URL node/add/forumtopic she is presented by the usual form
  4. On the form there is an email field with a check box underneath with the label “I would like to receive an email when comments are posted to my thread”
  5. She types in her email and marks the checkbox - yes, she would like to have email notifications
  6. She submits the form and when a comment is posted in her thread, she gets a notification email with a link to the comment and a link that allows her to unsubscribe from the thread.

I have looked at this nice writeup on groups.drupal.org where different notification modules are compared, but none seems to be offering the functionality I am looking for.

I have installed Comment Notify that offers the desired functionality - but only on comments, not on nodes.

I have tried installing Watcher, but it is early in development and still seems pretty buggy.

This seems to me like a very common scenario - what would be the recommended way of implementing this feature? Any help is very appreciated.

  • Why don't offer user registrations and make the visitors -> registered users? Or allow them to login using their social account using drupal.org/project/rpx – ANDiTKO Mar 10 '12 at 7:41
  • agreed. if they are entering their email, it seems like you would create a user account for them at that point – Aaron Ortega Mar 11 '12 at 8:22
  • I considered that, but since my use case is about anonymous counseling it is important that you don't have to register anywhere to post. Usabilitywise it is also more of a hassle to register before you post. – benjamin_dk Mar 11 '12 at 10:44

I would probably solve this with the following Rules-based setup:

1) Create a custom entity for anonymous posters with only a text field for email and an entity reference field for the node they created. Here's a pretty good writeup on creating custom entities: http://www.istos.it/blog/drupal-entities/drupal-entities-part-3-programming-hello-drupal-entity

And here's Drupal.org: http://drupal.org/node/1026420

2) Create a rule for "Node->After saving new content" that checks if the poster was anonymous and if so, creates a new anonymous posters entity with the user's email + reference to the created node.

3) Create a rule for "Comment->After saving a new comment" that does a "Fetch entity by property" action and after a anonymous poster entity, sends an email out to them.

The only trick you need to figure out is how to play with rules upon fetching entities and accessing their fields. You need to create some rules component so achieve this whole flow since in order to access the field in the entity, you need to verify the type of the entity and this happens in "conditions", which can't be done after "actions" which is where the "fetch entity by property" magic happens.

So you'll basically have to create a Rules Component that does what needs to be done with the fetched entity.

This is definitely not the only way to achieve what you need to accomplish, but since I'm a strong believer in the endless powers of Rules, I like solving things with it. :)

  • 1
    Hi Tommy, thanks for your suggestion. I never tried to setup anything with Rules and Entities - it seems to me that you have to make quite a set of Rules to replicate the functionality of e.g. Comment Notify. We ended up getting a custom module made - Node Notify [drupal.org/sandbox/donatasp/1513670] - which is in a sandbox. It works for our setup, but is in a very early stage of development. Contributors are welcome! – benjamin_dk May 17 '12 at 8:46
  • There's a typo in the URL above - here's the link again: Node Notify – benjamin_dk May 17 '12 at 8:52

You're welcome to try this new module I made which solves this problem using MailChimp: mailchimp_subscriptions.

Feedback is welcome! Planning to promote it to a full module soon.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.