WC_Email_Failed_Order::__constructpublicWC 1.0

Constructor.

Метод класса: WC_Email_Failed_Order{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Email_Failed_Order = new WC_Email_Failed_Order();
$WC_Email_Failed_Order->__construct();

Код WC_Email_Failed_Order::__construct() WC 10.5.0

public function __construct() {
	$this->id             = 'failed_order';
	$this->title          = __( 'Failed order', 'woocommerce' );
	$this->email_group    = 'orders';
	$this->template_html  = 'emails/admin-failed-order.php';
	$this->template_plain = 'emails/plain/admin-failed-order.php';
	$this->placeholders   = array(
		'{order_date}'   => '',
		'{order_number}' => '',
	);

	// Triggers for this email.
	add_action( 'woocommerce_order_status_pending_to_failed_notification', array( $this, 'trigger' ), 10, 2 );
	add_action( 'woocommerce_order_status_on-hold_to_failed_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
		? __( 'Select who should be notified if an order that was previously processing or on-hold has failed.', 'woocommerce' )
		: __( 'Failed order emails are sent to chosen recipient(s) when orders have been marked failed (if they were previously pending or on-hold).', 'woocommerce' );

	// Other settings.
	$this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) );

	if ( $this->block_email_editor_enabled ) {
		$this->description = __( 'Notifies admins when an order that was processing or on hold has failed.', 'woocommerce' );
	}
}