Add filter to ignore certain emails

[ad_1]

Plugin Support
Dake

(@dakeg)

Hi @dkneidhart

Thanks for reaching out, I have asked our developers about your filter question and will get back to you once I have an update.

Plugin Support
Dake

(@dakeg)

Hi @dkneidhart

Thank you for your patience.

We do have a filter, wp_mail_logging_before_log_email which the you can use to not log specific emails.

Example usage:

add_filter( 'wp_mail_logging_before_log_email', 'wp_mail_logging_filter' );

function wp_mail_logging_filter( $mail ) {

	if ( $mail['to'] === '[email protected]' ) {
		return false;
	}

	return $mail;
}

This will prevent emails to [email protected] from being logged.

$mail arg is an array which contains the following.

$mail['to']
$mail['subject']
$mail['headers']
$mail['attachments']

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer