13
Oct

Automatic Email Notification for Blog Comment Queue in Drupal

   Posted by: Brandon   in Computers & Technology

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

This has to be the dumbest thing about blogs and posting comments in Drupal; it does not give you the option to send an email notification when someone has left a comment. This becomes especially troublesome when you have comment moderation on, as it requires that you frequently login and check your moderation queue to approve or deny a comment. I finally got sick of it and decided to do something about it. The last time I checked, the module that allows for this sort of thing was not yet operational with 6.x so here is a quick mail hack to get drupal to send an email notification whenever a comment is send to the approval queue.

1. Open the file: YOUR_DRUPAL_DIRECTORY/modules/comment/comment.module

2. Go to about line 762 (this is for v6.3) where you should see a db_query(”INSERT…”) statement.

3. Enter a new line right under that line with the following:

mail(’youremail@here.com’, ‘New comment!’, $edit['comment']);

Now, whenever a comment is left, you will get an email! Obviously, you will need to replace “youremail@here.com” with the destination email you want. The second field is the email subject, and the third is the actual email content.

  • Share/Bookmark

Tags: , , ,

This entry was posted on Monday, October 13th, 2008 at 10:45 pm and is filed under Computers & Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 comments so far

NK
 1 

Thanks for this useful hack! If only I could figure out how to make it less of a hack, I could contribute something too.

November 4th, 2009 at 3:25 pm
 2 

I agree with you, it has been the problem on my blog too and i’m sick and tired of it. thanks for the simple tips on how to get rid of this.

March 9th, 2010 at 7:44 am

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment

Restrained Freedom is Digg proof thanks to caching by WP Super Cache!