Forum Replies Created
-
-
In the reference at https://developer.wordpress.org/reference/hooks/comment_moderation_recipients/, it shows:
apply_filters ( ‘comment_moderation_recipients’, array $emails, int $comment_id )
… am I supposed to include that “int $comment_id” somehow? The link you gave me does not talk about such added variables. I can’t find anything on it.
Okay, thanks. This is what I have now, still not getting the extra email. Can you see anything I’m doing wrong?
function calstage_comment_moderation_recipients($emails) {
$extra_emails = array(
‘ji@humortimes.com’,
);// combine the two arrays
$emails = array_merge($extra_emails, $emails);return $emails;
}
add_filter(‘comment_moderation_recipients’, ‘calstage_comment_moderation_recipients’);I tried this, and it doesn’t seem to work. Any suggestions?
// Send email to Lauren when comment submitted
function myCommentEmailFilter($comment_moderation_recipients){
if ($comment_moderation_recipients) {
$to = ‘ht1@dcn.org’;
$subject = ‘Comment submitted to CalStage.org website’;
$message = ‘A comment has been submitted that may require your attention. Log in at http://www.calstage.org/wp-login.php and click on Comments to see it.’;wp_mail( $to, $subject, $message );
}
}add_filter(‘comment_moderation_recipients’, ‘myCommentEmailFilter’);
Thanks. Do you know of any way to change the notification process so that comment moderation notices can be sent to editors, for example?