Notification Emails Not Send After Comment Approval in WordPress 2.5 and 2.5.1

In WordPress 2.5 and Wordpress 2.5.1, when the option is set to email post author whenever a comment is posted (comments_notify = 1), no notification email is generated or sent to notify the post author if the comment is held in moderation queue and is only approved later via edit-comments.php.

Prior to WordPress 2.5, an email is sent on approval to post author even if a comment is required to be approved and not posted instantly. However, notification that a comment is held for moderation and require administrator’s action to approve, delete or spam the message is working properly, with email sends to administrator’s email address (admin_email), not post author.

It’s a bug that has been introduced in WordPress 2.5, and slips into WordPress 2.5.1 when moderation.php functionality was moved into edit-comments.php. The bug will probably be fixed in WordPress 2.5.2 release. If you can’t wait, simply edit wp-includes/comment.php on WordPress blog directory on web server, and add the following lines of code:

Before:

break;
case 'approve':
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);
break;
case 'spam':
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);

After:

break;
case 'approve':
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);
if ( get_option( 'comments_notify' ) == true ) {
wp_notify_postauthor( $comment );
}
break;
case 'spam':
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);

18 Responses to “Notification Emails Not Send After Comment Approval in WordPress 2.5 and 2.5.1”

  1. Иван
    February 25th, 2010 09:43
    18

    Достаточно интересный проект, срочно в избранное :) !

  2. rap indir
    February 24th, 2010 17:22
    17

    thank you ;)

  3. Иван
    February 10th, 2010 08:35
    16

    Не дурный ресурс где бы такой же движок взять? Может ссылочку дадите?!

  4. Max
    February 3rd, 2010 08:23
    15

    Не дурный проект и гостевушка удобная, так что респект автору!

  5. Sooran
    September 15th, 2009 17:55
    14

    tancks.
    This Post Helped me
    Good Time

  6. rap dinle
    July 23rd, 2009 01:49
    13

    Much thanks for sharing your solution!

  7. Annanta
    July 16th, 2009 04:43
    12

    Hi friends,

    Check this out. (Wordpress or phpBB not sending mails?)

    In your c-panel there is an icon called MXentry as shown in image below, click it wordpress mail not sending 1

    In the upper gray box there is a line (As shown in the image below) “Always accept mail locally even if the primary mx does not point to this server” in front of that there is a check box, If you enable this then all mails will come to local server in spite of MX changes, So Need to DISABLE this function.

    Admin Note: Should add your domain to /etc/remotedomains instead.

  8. Rob Layton
    March 24th, 2009 02:34
    11

    In case this doesn’t work, or you need details on the the cPanel method, I wrote it all out at http://www.roblayton.net/archive/wordpress-not-sending-emails-anymore-solved/

    Good luck!

  9. mike
    January 18th, 2009 19:13
    10

    Ldn2m0 hi! how you doin?

  10. Marcin
    October 15th, 2008 07:26
    9

    In 2.6.1 it should look as this:

    case 'approve':
    $query = $wpdb->prepare("UPDATE wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);
    if ( get_option('comments_notify') == true ) {
    $comment = get_comment($comment_id);
    wp_notify_postauthor($comment_id, $comment->comment_type);
    }

    The only change is adding:

    == true

  11. ordersomabuyg
    September 22nd, 2008 05:42
    8

    Wow Cool !
    Super Man
    Nice Site

  12. Chris
    September 4th, 2008 04:15
    7

    This WPMU behavior was driving me a bit nuts. Much thanks for sharing your solution!

  13. paul
    July 11th, 2008 17:30
    6

    Thanks for the post ‘admin’ – I help manage a (non?)corporate blog, and my boss stopped getting email notifications since upgrading to 2.5.x – I do believe your suggested patch has fixed it.

    So, again thanks very much!

  14. Guillermo Scharffenorth
    June 27th, 2008 20:49
    5

    Hello,

    Tried it. It did not work. Thanks anyways.

  15. admin
    June 20th, 2008 12:28
    4

    Try to just add in the additional lines (the difference).

  16. Guillermo Scharffenorth
    June 20th, 2008 11:57
    3

    Hi,

    The code I posted is from 2.5.1. Do you think that replacing this code with the one you posted could fix this issue?

  17. admin
    June 20th, 2008 11:53
    2

    version 2.5.

  18. Guillermo Scharffenorth
    June 20th, 2008 11:29
    1

    Hello,

    The code you printed under ‘before’ is different in that the one in wp-includes/comment.php. This is the code in comment.php:

    case 'approve':
    $query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1";
    break;
    case 'spam':
    $query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";

    Which version of WP did you get that code from?

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.

New Articles

Incoming Search Terms for the Article

wordpress comment notification - wordpress email not working - wordpress not sending email - wordpress email notification not working - wordpress email notification - wordpress not sending emails - wordpress comments notification - comment notification wordpress - wordpress comment email notification - wordpress comment notification email - wordpress - wordpress notify comments - wordpress blogs - wordpress comments_notify - wordpress not sending mail - wordpress not emailing - wordpress email comment notification - wordpress notification - wordpress email notifications - wordpress notifications - wordpress comment notify - wordpress comment notification not working - wordpress not sending notification - post notification wordpress - wordpress registration email not working - wordpress comments not sending email - wordpress comment notifications - wordpress comments email notification - wordpress not getting email notifications - all - Wordpress Multi Author comment notification - $wpdb->prepare - wordpress comment approval - wordpress doesn't send emails - wordpress email notification problem - wordpress notification of comment - wordpress not emailing comments - wordpress email comments for approval - wordpress notify author comment - wordpress author comment notification - wordpress comment approval email - wordpress Notify on comment - comment notification email wordpress - wordpress Comment notification emails - wordpress mail not working - wordpress auto approve comments - wordpress emails - wordpress notification comment - not getting wordpress emails - email notification wordpress -