WC_Email_New_Order::__construct
Constructor.
Метод класса: WC_Email_New_Order{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WC_Email_New_Order = new WC_Email_New_Order(); $WC_Email_New_Order->__construct();
Код WC_Email_New_Order::__construct() WC Email New Order:: construct WC 10.4.3
public function __construct() {
$this->id = 'new_order';
$this->title = __( 'New order', 'woocommerce' );
$this->email_group = 'orders';
$this->template_html = 'emails/admin-new-order.php';
$this->template_plain = 'emails/plain/admin-new-order.php';
$this->placeholders = array(
'{order_date}' => '',
'{order_number}' => '',
);
// Triggers for this email.
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_cancelled_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_email_footer', array( $this, 'mobile_messaging' ), 9 ); // Run before the default email footer.
// Call parent constructor.
parent::__construct();
// Must be after parent's constructor which sets `email_improvements_enabled` property.
$this->description = $this->email_improvements_enabled
? __( 'Receive an email notification every time a new order is placed', 'woocommerce' )
: __( 'New order emails are sent to chosen recipient(s) when a new order is received.', 'woocommerce' );
// Other settings.
$this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) );
if ( $this->block_email_editor_enabled ) {
$this->description = __( 'Notifies admins when a new order has been placed.', 'woocommerce' );
}
}