WC_Emails::__construct
Constructor for the email class hooks in all emails that can be sent.
Method of the class: WC_Emails{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$WC_Emails = new WC_Emails(); $WC_Emails->__construct();
WC_Emails::__construct() WC Emails:: construct code WC 10.6.2
public function __construct() {
$this->init();
// Email Header, Footer and content hooks.
add_action( 'woocommerce_email_header', array( $this, 'email_header' ) );
add_action( 'woocommerce_email_footer', array( $this, 'email_footer' ) );
add_action( 'woocommerce_email_order_details', array( $this, 'order_downloads' ), 10, 4 );
add_action( 'woocommerce_email_order_details', array( $this, 'order_details' ), 10, 4 );
add_action( 'woocommerce_email_order_meta', array( $this, 'order_meta' ), 10, 3 );
add_action( 'woocommerce_email_customer_details', array( $this, 'customer_details' ), 10, 3 );
add_action( 'woocommerce_email_customer_details', array( $this, 'email_addresses' ), 20, 3 );
add_action( 'woocommerce_email_customer_details', array( $this, 'additional_checkout_fields' ), 30, 3 );
add_action( 'woocommerce_email_customer_address_section', array( $this, 'additional_address_fields' ), 30, 4 );
if ( FeaturesUtil::feature_is_enabled( 'fulfillments' ) ) {
// Fulfillment details and meta.
add_action( 'woocommerce_email_fulfillment_details', array( $this, 'fulfillment_details' ), 10, 5 );
add_action( 'woocommerce_email_fulfillment_meta', array( $this, 'fulfillment_meta' ), 30, 4 );
}
// Hooks for sending emails during store events.
add_action( 'woocommerce_low_stock_notification', array( $this, 'low_stock' ) );
add_action( 'woocommerce_no_stock_notification', array( $this, 'no_stock' ) );
add_action( 'woocommerce_product_on_backorder_notification', array( $this, 'backorder' ) );
add_action( 'woocommerce_created_customer_notification', array( $this, 'customer_new_account' ), 10, 3 );
// Hook for replacing {site_title} in email-footer.
add_filter( 'woocommerce_email_footer_text', array( $this, 'replace_placeholders' ) );
/**
* Action hook for email classes to hook into.
*
* @since 3.0.0
* @param WC_Emails $this The WC_Emails instance.
*/
do_action( 'woocommerce_email', $this );
}