WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] custom email recipient in comments notification e-mail (3 posts)

  1. crysman
    Member
    Posted 12 months ago #

    Please, we are using WP as CMS and we are looking for a way how to customize the comments notification e-mail recipient.

    By default, the post author's e-mail is being used for comments notification. But we need a custom e-mail, or (even better) comma-separated list of e-mails on which to send the notification about new comments. Not only the post author's e-mail.

    How to do it please? Any plugin? Or is there some hook to (that some) WP e-mail notification function which could we use?

  2. x500.net
    Member
    Posted 12 months ago #

    WordPress Codex - comment_post

    You can try this:

    add_action('comment_post', 'notify_author_of_reply', 10, 2);
    
    function notify_author_of_reply($comment_id, $approved){
      if($approved){
        $comment = get_comment($comment_id);
        if($comment->comment_parent){
          $parent_comment = get_comment($comment->comment_parent);
          wp_mail($parent_comment->comment_author_email, 'Hello', 'Dude you got a reply...');
        }
      }
    }

    source: http://wordpress.stackexchange.com/a/36590

    alternatively, you may be interested in this plugin

  3. crysman
    Member
    Posted 11 months ago #

    Thanks for help, that plugin seems to be useful and usable.

Reply

You must log in to post.

About this Topic