1

I have to edit the mail content which is default one to send notification to the post author when a comment is submitted. I need to add my custom content by replacing the existing comment mail content. So is there any action or function to override this default email template with mine custom one.

1 Answer 1

1

You can apply a filter to comment_notification_text:

1525            /**
1526             * Filter the comment notification email text.
1527             *
1528             * @since 1.5.2
1529             *
1530             * @param string $notify_message The comment notification email text.
1531             * @param int    $comment_id     Comment ID.
1532             */
1533            $notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );

If you have extensive changes to make, since the function containing that hook is pluggable, you may find it easier to replace the entire function.

2
  • I guess it will help me. Let me check it and get back to you
    – Kvvaradha
    Nov 28, 2015 at 6:22
  • hi, i have two more doubt associated with it. howcan i change it to html email and how can i change the subject of this mail
    – Kvvaradha
    Mar 8, 2016 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.