woocommerce_email_before_order_table action-hookWC 2.5.0

Action hook to add custom content before order details in email.

Usage

add_action( 'woocommerce_email_before_order_table', 'wp_kama_woocommerce_email_before_order_table_action', 10, 4 );

/**
 * Function for `woocommerce_email_before_order_table` action-hook.
 * 
 * @param WC_Order $order         Order object.
 * @param bool     $sent_to_admin Whether it's sent to admin or customer.
 * @param bool     $plain_text    Whether it's a plain text email.
 * @param WC_Email $email         Email object.
 *
 * @return void
 */
function wp_kama_woocommerce_email_before_order_table_action( $order, $sent_to_admin, $plain_text, $email ){

	// action...
}
$order(WC_Order)
Order object.
$sent_to_admin(true|false)
Whether it's sent to admin or customer.
$plain_text(true|false)
Whether it's a plain text email.
$email(WC_Email)
Email object.

Changelog

Since 2.5.0 Introduced.

Where the hook is called

In file: /templates/emails/email-order-details.php
woocommerce_email_before_order_table
woocommerce/templates/emails/email-order-details.php 42
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
woocommerce/templates/emails/plain/email-order-details.php 20
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email );

Where the hook is used in WooCommerce

woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php 95
add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );
woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php 64
add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );
woocommerce/includes/gateways/cod/class-wc-gateway-cod.php 79
add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );