woocommerce_email_recipient_(id) filter-hookWC 2.0.0

Filter the recipient for the email.

Usage

add_filter( 'woocommerce_email_recipient_(id)', 'wp_kama_woocommerce_email_recipient_id_filter', 10, 3 );

/**
 * Function for `woocommerce_email_recipient_(id)` filter-hook.
 * 
 * @param string   $recipient Recipient.
 * @param object   $object    The object (ie, product or order) this email relates to, if any.
 * @param WC_Email $email     WC_Email instance managing the email.
 *
 * @return string
 */
function wp_kama_woocommerce_email_recipient_id_filter( $recipient, $object, $email ){

	// filter...
	return $recipient;
}
$recipient(string)
Recipient.
$object(object)
The object (ie, product or order) this email relates to, if any.
$email(WC_Email)
WC_Email instance managing the email.

Changelog

Since 2.0.0 Introduced.
Since 3.7.0 Added $email parameter.

Where the hook is called

WC_Email::get_recipient()
woocommerce_email_recipient_(id)
woocommerce/includes/emails/class-wc-email.php 502
$recipient  = apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object, $this );

Where the hook is used in WooCommerce

Usage not found.