Community Documentation

Comment Notify

Last updated February 3, 2010. Created by greggles on April 29, 2008.
Edited by Pinatz, Elijah Lynn, afaaro. Log in to edit this page.

The Comment Notify Module improves your site by allowing both authenticated & anonymous users to get email notifications about comments on threads to which they've commented.

Fixing the "All Old Commenters Get Mails Even If They Didn't Request Them"

In versions prior to 5.x-1.7 all of the old commenters would get an email even if they never requested it. This was due to setting the default notification status to "true" for all comments in the database. That has now been fixed for new installations, but it requires a manual step to fix the problem for old users. The reason it is manual is that it takes specific human site knowledge to udpate the database properly.

If you want to be "conservative" and make sure that all users who get emails really requested them you can use this logic:

The first comment that has a "notify" status of 0 opted out of an email and must have come after the module was installed. So, if all comments before that have their update status changed to false then you guarantee you won't be sending mails to anyone who didn't request them

Here are the queries to achieve this logic (tested on mysql only, but should work):

select min(timestamp) from comments where notify = 0;
+----------------+
| min(timestamp) |
+----------------+
|     1141431420 |
+----------------+
1 row in set (0.00 sec)

mysql> update comments set notify = 0 where timestamp < 1141431420;

Note how the result from the first query becomes part of the second query...

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 5.x, Drupal 6.x

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.