One of the great features of Wordpress is that you can set up your site to send an email every time a comment needs approval. Drupal doesn't come with this functionality out of the box, but we're going to show you how to do it yourself using the module Workflow-ng and some basic user configurations.
The versions used in this tutorial are Drupal 5.15 and Workflow-ng 2.2 if that helps any.
You'll want to have two separate roles: an anonymous user role who will be posting comments, and the role that will approve the comments. The anonymous user is already created in Drupal, but you'll want to create one more role that will receive the email to approve the comment. I called mine "super admin". Make sure whoever is moderating comments is in that user role.

Go to the Access Control screen (yoursite.com/admin/user/access), and make sure that the "post comments without approval" permission is unchecked. For your moderator role, make sure that the "administer comments" permission is checked. Save your changes.
Workflow-ng is a powerful little module that lets you set up criteria and trigger actions when those criteria are met. Our rule is to send an email to the comment moderator when an anonymous user submits a comment. Lets translate this into Drupal-speak:
Create a new rule: go to the Workflow-ng admin page (you'll see a link at the bottom of the navigation menu. If you don't, give your account the "administer workflow-ng" permission). Click on the "Add a new rule configuration" tab at the top of the screen. For "Event" select "Comment has been created" from the dropdown. Give your rule a name, and make sure the "this rule is active" box is checked. Click Submit.

Add a Condition: Since we only want to get notified when anonymous users post comments, we need to have the system check to this condition before sending. Click the "Add a condition" link on the next page. From the dropdown, select "user has role(s)", and click Add.
On the next screen, make sure the "User to test" dropdown is set to "created comment author", and select "anonymous user" as the role. Click Submit to save.

Add the action: Now we need to specify that we want to send an email once the user makes a comment. Click on the "Add an action" link, and from the dropdown select "Send mail to all users of a role" and click Add.
On the next screen, check the box next to the role who should receive the email. Give your email a subject line, and write a snappy message. I included information on the comment and where to approve it to make it easy for the moderator. Workflow-ng gives you a list of dynamic tags that you can use in your email to give the moderator additional info on the comment. Click Submit.

The #1 rule of web development is test, test, test. Log out of your site and go to your blog (or any other post that is open for comments). Leave a comment (don't worry, you can delete it later). Check your email, and you should have some email love in your inbox. You got your email? Good.
Now you'll want to test as a logged-in user to make sure you're not getting emails for comments that are already approved. Log back into your site, and go back and post another comment. Did you get an email? No? Cool, then everything is working right!
And you're done! Congratulations on rocking your first Workflow-ng rule.
JR72 said on December 27, 2009 - 6:44pm
I just found other topics on other sites explaining how it's possible to use the "Trigger" and "Action" functionality built in to D6
I just set this up on my site to be notified of incoming comments and it works a charm - nice and simple too
Basically:
1. Enable the Trigger module
2. Administer > Site Configuration > Actions > "Make a new advanced action available" (bottom of built in action list) > "Send email..." from drop down
3. Fill out the form taking note of the system variables - the email address is the recipient, ie the webmaster / moderator
4. Administer > Site Building > Triggers > Comments "tab" (top of page that I completely missed for 5 mins, lol) > "Trigger: After saving a new comment" and "Trigger: After saving an updated comment" choose your action from the drop down (mine ended up under the "System" category
5. TEST!
PS Thanks for this page and all the others, there's some really useful stuff here, well explained too :D
Post new comment