Posts Tagged ‘mail hack’
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.
Tags: approval queue, drupal, mail hack, notification