woocommerce_email_log_enabled filter-hookWC 10.9.0

Filter whether to log this transactional email attempt.

Return false to skip logging for a particular email or globally.

Usage

add_filter( 'woocommerce_email_log_enabled', 'wp_kama_woocommerce_email_log_enabled_filter', 10, 3 );

/**
 * Function for `woocommerce_email_log_enabled` filter-hook.
 * 
 * @param bool     $enabled  Whether logging is enabled.
 * @param string   $email_id The email type ID.
 * @param WC_Email $email    The WC_Email instance.
 *
 * @return bool
 */
function wp_kama_woocommerce_email_log_enabled_filter( $enabled, $email_id, $email ){

	// filter...
	return $enabled;
}
$enabled(true|false)
Whether logging is enabled.
$email_id(string)
The email type ID.
$email(WC_Email)
The WC_Email instance.

Changelog

Since 10.9.0 Introduced.

Where the hook is called

EmailLogger::handle_woocommerce_email_sent()
woocommerce_email_log_enabled
EmailLogger::log_non_send_outcome()
woocommerce_email_log_enabled
woocommerce/src/Internal/Email/EmailLogger.php 89
if ( ! apply_filters( 'woocommerce_email_log_enabled', true, $email_id, $email ) ) {
woocommerce/src/Internal/Email/EmailLogger.php 246
if ( ! apply_filters( 'woocommerce_email_log_enabled', true, $email_id, $email ) ) {

Where the hook is used in WooCommerce

Usage not found.