尽管确定发送额外通知的原因(转发设置?)很有用,有一种方法可以在发布评论时调整谁收到通知电子邮件(这是您所问的,而不是如何解决问题):
// adds emails to the \'notify admins on comment submit\'
// from http://www.sourcexpress.com/customize-wordpress-comment-notification-emails/
// must be enabled via Settings, Discussion, "Email me whenever Anyone posts a comment"
function ss_comment_moderation_recipients( $emails, $comment_id ) {
// Email notification only to the admin
$emails = array( get_option( \'admin_email\' ) );
$emails[] = "[email protected]";
$emails[] = "[email protected]";
return $emails;
}
add_filter( \'comment_moderation_recipients\', \'ss_comment_moderation_recipients\', 11, 2 );
add_filter( \'comment_notification_recipients\', \'ss_comment_moderation_recipients\', 11, 2 );
$emails数组是要发送到的电子邮件数组。上面的代码获取admin\\u电子邮件地址,然后向其中添加两封电子邮件。需要两个add\\u过滤器来确保其正常工作。
根据这里的答案:http://www.sourcexpress.com/customize-wordpress-comment-notification-emails/