WordPress.org

Forums

Email after comment is posted - How to add comment ID in subject? (8 posts)

  1. Alexine
    Member
    Posted 9 years ago #

    All the e-mail notices for comments get saved into one conversation by gmail, which is extremely annoying.

    Is there any way I can add the comment ID in the subject of the e-mails?

    Thanks

  2. jwilliams
    Member
    Posted 9 years ago #

    open this file...

    wp-admin/wp-email-notification/index.php

    find the line where the email's subject is generated, (Ctrl+F type subject into firefox).

    Then simply add the following line inside that line (if you're adding it into <?php tags then don't write them again!)...

    <?php echo " - " . the_ID(); ?>

  3. Alexine
    Member
    Posted 9 years ago #

    Erm, won't that just print out the id on the HTML page?

    And I don't have that file. All I found was wp-mail.php and nowhere could I find a line which mailed the admin after comments.

  4. jwilliams
    Member
    Posted 9 years ago #

    OKAY, good and true, sorry, wasn't with it on that one! how about this:
    in the file:

    ./wp-includes/pluggable-functions.php

    find line 359 which reads...

    @wp_mail($admin_email, $subject, $notify_message);

    Right before this line, add the line

    $subject = $subject . " - " . $comment->comment_post_ID;

    THIS SHOULD DO IT!

  5. Alexine
    Member
    Posted 9 years ago #

    Nope doesn't work :( I just get the same subject as I used to. Even the "-" doesn't show up in the subject :s

  6. Alexine
    Member
    Posted 9 years ago #

    bump?

  7. Alexine
    Member
    Posted 9 years ago #

    Bump again -.-

    Someone much know how to get this done.

  8. Alexine
    Member
    Posted 9 years ago #

    Bump again?

Topic Closed

This topic has been closed to new replies.

About this Topic