把以下代码添加到当前主题functions.php文件中
//留言审核通过邮件通知 function ludou_comment_approved($comment) { if(is_email($comment->comment_author_email)) { $post_link = get_permalink($comment->comment_post_ID); // 邮件标题 $title = '您在 [Chiser丶] 的评论已通过审核'; // 邮件内容 $body = '您在Chiser丶《<a href="'.$post_link.'">'.get_the_title($comment->comment_post_ID).'</a>》发表的评论:<br /> '.$comment->comment_content.'<br /><br /> 已通过管理员审核并显示。<br /> 您可在此查看您的评论:<a href="'.get_comment_link( $comment->comment_ID ).'">前往查看</a>'; @wp_mail($comment->comment_author_email, $title, $body, "Content-Type: text/html; charset=UTF-8"); } }