woocommerce_email_skipped action-hookWC 10.9.0

Fires when a transactional email is not sent for a reason other than being disabled.

The $reason parameter identifies why the email was not sent:

  • WC_Email::SKIP_REASON_NO_RECIPIENT: No recipient address was available at send time.

Usage

add_action( 'woocommerce_email_skipped', 'wp_kama_woocommerce_email_skipped_action', 10, 3 );

/**
 * Function for `woocommerce_email_skipped` action-hook.
 * 
 * @param string   $reason   Short identifier for why the email was skipped.
 * @param string   $email_id The email type ID.
 * @param WC_Email $email    The WC_Email instance.
 *
 * @return void
 */
function wp_kama_woocommerce_email_skipped_action( $reason, $email_id, $email ){

	// action...
}
$reason(string)
Short identifier for why the email was skipped.
$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

WC_Email::send_notification()
woocommerce_email_skipped
WC_Email::send_if_recipient()
woocommerce_email_skipped
woocommerce/includes/emails/class-wc-email.php 1169
do_action( 'woocommerce_email_skipped', self::SKIP_REASON_NO_RECIPIENT, $this->id, $this );
woocommerce/includes/emails/class-wc-email.php 1205
do_action( 'woocommerce_email_skipped', self::SKIP_REASON_NO_RECIPIENT, $this->id, $this );

Where the hook is used in WooCommerce

woocommerce/src/Internal/Email/EmailLogger.php 49
add_action( 'woocommerce_email_skipped', array( $this, 'handle_woocommerce_email_skipped' ), 10, 3 );