• Resolved planetthoughtful

    (@planetthoughtful)


    Hi All,

    Under Options > Dicussion I have “Email me whenever anyone posts a comment” checked as true.

    I don’t, however, seem to receive any emails when comments are made.

    I know the PHP mail() function is working, as I built my own feedback forms for my site, which make use of the mail() function, and which send me emails as expected.

    A couple of questions:

    * Does anyone know if WP doesn’t send an email when the comment is made by the author of the post / administrator? As in, am I unaware of some functionality that only sends an email when the comment is made by someone other than the post author / administrator?

    * I also have “Email me whenever a comment is held for moderation” checked as true. Is there possibly some kind of conflict between these two comment email options?

    * Any other suggestions why this might not be working?

    I’m using WP 2.0.1, but noticed this with WP 2.0 as well.

    Many thanks,

    planetthoughtful

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter planetthoughtful

    (@planetthoughtful)

    Okay, seems I’ve been able to answer my own question.

    After digging around in the code it does appear that WP won’t send a copy of a comment if it’s made by the post author.

    Much warmth,

    planetthoughtful

    How did you make it so that the post author doesn’t receive comment notifications for their own comments? I receive them for everyone, including myself, although they are a bit messed up.

    Thread Starter planetthoughtful

    (@planetthoughtful)

    That seems to be the default behavior, at least in 2.0.1.

    Unless I’m mistaken, the following code in \wp-includes\comment-functions.php, should mean that emails aren’t sent to the post author:

    $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment

    if ( get_settings('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_ID'] )
    wp_notify_postauthor($comment_ID, $commentdata['comment_type']);

    Basically, the && $post->post_author != $commentdata['user_ID'] condition in the if statement should mean that if the comment user_ID and the post post_author match, you won’t be sent an email.

    Thread Starter planetthoughtful

    (@planetthoughtful)

    As an additional note: I tested this by logging out of WordPress and submitting a comment as though I were just a visitor to the site. That comment sent me an email. Logging back in as myself and submitting a comment didn’t send me an email. So, I can confirm that the above code seems to operate as the code itself implies it should.

    Something is really wrong with my comment notifications then.

    I a) still get them for myself and b) the from address is always commentersname@localhost instead of their actual address.

    I can’t figure out what’s causing either of these things.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not receiving emails when comments made’ is closed to new replies.