WC_Email_Customer_Cancelled_Order::__construct
Constructor.
Method of the class: WC_Email_Customer_Cancelled_Order{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Email_Customer_Cancelled_Order = new WC_Email_Customer_Cancelled_Order(); $WC_Email_Customer_Cancelled_Order->__construct();
WC_Email_Customer_Cancelled_Order::__construct() WC Email Customer Cancelled Order:: construct code WC 10.8.1
public function __construct() {
$this->id = 'customer_cancelled_order';
$this->customer_email = true;
$this->title = __( 'Cancelled order', 'woocommerce' );
$this->email_group = 'order-changes';
$this->template_html = 'emails/customer-cancelled-order.php';
$this->template_plain = 'emails/plain/customer-cancelled-order.php';
$this->placeholders = array(
'{order_date}' => '',
'{order_number}' => '',
'{order_billing_full_name}' => '',
);
// Triggers for this email.
add_action( 'woocommerce_order_status_processing_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 );
// Call parent constructor.
parent::__construct();
// Must be after parent's constructor which sets `email_improvements_enabled` property.
$this->description = $this->email_improvements_enabled
? __( 'Send an email to customers notifying them when their order has been cancelled', 'woocommerce' )
: __( 'Cancelled order emails are sent to customers when their orders have been marked cancelled (if they were previously processing or on-hold).', 'woocommerce' );
if ( $this->block_email_editor_enabled ) {
$this->title = __( 'Order cancelled', 'woocommerce' );
$this->description = __( 'Notifies customers when their order has been cancelled.', 'woocommerce' );
}
}