Tagged: help
Hello Tosin,
Please replace the following line:
$headers .= "From: " . $sender_name . " <" . $sender_email . ">" . "\r\n";
with
$headers .= "From: " . $sender_name . "\r\n"; $headers .= "Bcc: " . $sender_email . "\r\n";
Now, Give it a shot and let me know if it works or not.
Regards
RaviHello Ravi,
Kindly see screenshot https://ibb.co/YhzMN3J
The mail was sent to one recipient but the emails of other recipients can viewed.
Thanks
Hello Tosin,
Replace this function “bp_follow_notify_author_followers” with following code:
function bp_follow_notify_author_followers( $new_status, $old_status, $post ) { if ( $new_status === $old_status || 'publish' !== $new_status ) { return; } $post = get_post( $post ); $options = get_option( 'bp_follow_notify_settings' ); $selected_post_types = empty( $options['bp_follow_notify_post_types'] ) ? array() : $options['bp_follow_notify_post_types']; if ( ! in_array( $post->post_type, $selected_post_types ) ) { return; } $author_id = $post->post_author; $author_name = get_the_author_meta( 'display_name', $author_id ); $counts = bp_follow_total_follow_counts( array( 'user_id' => $author_id ) ); if ( empty( $counts['followers'] ) ) { return; } $followers = bp_follow_get_followers( array( 'user_id' => $author_id ) ); $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); $subject = '[' . $blog_name . '] New Post From ' . $author_name; $message = sprintf( __( ' %2$s %3$s Link: %4$s ----------- You are receiving this email because you are following %1$s.', 'bp-follow-notify' ), $author_name, $post->post_title, wp_trim_words( $post->post_content ), get_permalink( $post->ID ) ); $notifying_emails = array(); foreach ( $followers as $follower ) { /* Email Notification */ $user = get_user_by( 'id', $follower ); $notifying_emails[] = $user->user_email; /* BP Notification */ if ( bp_is_active( 'notifications' ) ) { bp_notifications_add_notification( array( 'user_id' => $user->ID, 'item_id' => $post->ID, 'secondary_item_id' => $author_id, 'component_name' => 'bp_follow_notify', 'component_action' => 'follow_new_post', 'date_notified' => bp_core_current_time(), 'is_new' => 1, ) ); } } $sender_name = ( ! empty( $options['bp_follow_notify_sender_name'] ) ? $options['bp_follow_notify_sender_name'] : $blog_name ); $sender_email = ( ! empty( $options['bp_follow_notify_sender_email'] ) ? $options['bp_follow_notify_sender_email'] : 'no-reply@' . $blog_name ); $headers = ''; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=" . get_bloginfo( 'charset' ) . "" . "\r\n"; $headers .= "From: " . $sender_name . " <" . $sender_email . ">" . "\r\n"; $bcc_emails = join( ',', $notifying_emails ); $headers .= "Bcc: " . $bcc_emails . "\r\n"; $admin_email = get_option( 'admin_email' ); @wp_mail( $admin_email, $subject, $message, $headers ); }
Try this.
Regards
Ravi- This reply was modified 3 years, 8 months ago by Ravi.
Hello Tosin,
I have tested this and it was working for me. By default, I am using admin email in the context of “To” and the rest of the followers emails under “Bcc”. Check the following URL:
Have you replaced “bp_follow_notify_author_followers” with above mentioned?
Regards
Ravi
You must be logged in to reply to this topic.
This topic is: resolved