Plugin Author
r-a-y
(@r-a-y)
There currently isn’t an easy hook to remove email notifications.
I’ll try to add one in v1.3.
In the meantime, try this:
// Disables emails from sending on the start following hook.
// Untested and might not work.
add_action( 'bp_follow_start_following', function() {
add_action( 'phpmailer_init', 'ray_disable_email_content', 999 );
}, 9 );
/**
* Wipes out the email content when sending an email.
*
* This will disable email sendouts since the email body will be empty.
*
* @param object $phpmailer The current $phpmailer object.
*/
function ray_disable_email_content( $phpmailer ) {
$phpmailer->IsHTML( false );
$phpmailer->AltBody = '';
$phpmailer->Body = '';
}
Untested. If it doesn’t work, you’ll have to code your own workaround in the meantime.
Thread Starter
maelga
(@maelga)
Thanks for this r-a-y.
It does not work though.
In bp-follow-notifications.php there is this check:
// Check to see if this leader has already been notified of this follower before
$has_notified = bp_get_user_meta( $r['follower_id'], 'bp_follow_has_notified', true );
Is there a way to force this as if an email had already been sent?
This way, no email would be sent “again”.
Thread Starter
maelga
(@maelga)
R-a-y nevermind.
I just commented // wp_mail( $to, $subject, $message );
That will do for now.
But it will be good to have the option to disable email notification in the next version.
Thanks for your support.
Plugin Author
r-a-y
(@r-a-y)
WP provides a filter for user meta, perhaps you can hook into that temporarily?
I will definitely make it easy to disable emails with a code snippet though for v1.3.