WordPress.org

Ready to get started?Download WordPress

Forums

New Comment Notification Email mod (14 posts)

  1. bstapylton
    Member
    Posted 4 years ago #

    I would like to know which file, or under which table/field I will be able to find the string that represents the template of the email that is sent to Authors when a new comment is made on one of their posts.

    I plan to remove details like the Email of the user who made the comment, the IP and the whois link. Authors on my site really shouldn't have access to that information.

    Just a pointer on where to look would be great!

  2. Mohammad Jangda
    Member
    Posted 4 years ago #

    This should work (add your functions.php file):

    function remove_sensitive_info( $text ) {
        // $text is the body of the email. Replace it or modify it to whatever you want
        return $text;
    }
    add_filter('comment_notification_text', 'remove_sensitive_info');
  3. bstapylton
    Member
    Posted 4 years ago #

    Thanks, I'll give it a go.

  4. spacebrew
    Member
    Posted 4 years ago #

    I was looking for the same thing. I put that code in my functions, and it crashes the site. Undefined function "add_filter". Is there supposed to be another set of brackets or something around that? Thanks for any help.

  5. Tosh
    Member
    Posted 3 years ago #

    I tried this and it's still showing the IP and email for me :/

  6. Tosh
    Member
    Posted 3 years ago #

    Anyone have any ideas. That has to be possible.

  7. Daniel Bachhuber
    Hand Built
    Posted 3 years ago #

    @spacebrew If the code snippet crashes the site, it sounds like you may have a syntax error. Try using WP_DEBUG to diagnose the error.

    @xberserker Can you share the code you have thus far? You'll need to parse the existing comment text for the IP address and email and replace them with empty strings.

  8. Tosh
    Member
    Posted 3 years ago #

    @Daniel sure this is what I have so far. But not sure if it's WordPress 3 ready or not .. been a while since I last tried anything. But I have this as a plugin and it does nothing right now to strip the comment email and IP from the email that gets sent out. So it's a useless plugin I have disabled for the moment. If I can get this working I'll add it as a plugin to the directory if people would find it useful.

    [Code moderated as per the Forum Rules. Please use the pastebin]

  9. Tosh
    Member
    Posted 3 years ago #

    Or maybe I'm doing this the hard way .. might be an easier way. But it has to be possible ...

  10. Tosh
    Member
    Posted 3 years ago #

    This has to be possible. Anyone have any input on this?

  11. Tosh
    Member
    Posted 3 years ago #

    Sorry forgot I had to use pastebin. Here is what I have so far that isn't working. I know others would benefit from this if we figured this out. Then I could submit this as a plugin for others to use.

    http://pastebin.com/TqKXybYS

    Little help? lol

  12. Tosh
    Member
    Posted 3 years ago #

    I'm sure others would find this useful. Can I get a hint at least?

  13. Tosh
    Member
    Posted 3 years ago #

  14. Tosh
    Member
    Posted 3 years ago #

    Ah! Think I got it working! I'll do some more tests and report back. But it isn't showing the email or IP address in the email that gets sent out.

Topic Closed

This topic has been closed to new replies.

About this Topic