get_emails(); $email = $emails['WC_Email_Cancelled_Order']; if ( ! $email ) { return; } $this->id = $email->id; $this->title = $email->get_title(); $this->root_email = $email; $this->recipient = function_exists( 'yaymail_get_email_recipient_zone' ) ? yaymail_get_email_recipient_zone( $email ) : ''; $this->render_priority = apply_filters( 'yaymail_email_render_priority', $this->render_priority, $this->id ); add_filter( 'wc_get_template', [ $this, 'get_template_file' ], $this->render_priority ?? 10, 3 ); $this->maybe_disable_block_email_editor(); } public function get_default_elements() { $email_title = __( 'Order Cancelled: #{order_number}', 'woocommerce' ); $email_title = str_replace( '#{order_number}', '', $email_title ); // translators: %1$s: order id, %2$s: customer name. $email_text = sprintf( esc_html__( 'Notification to let you know — order #%1$s belonging to %2$s has been cancelled:', 'woocommerce' ), '[yaymail_order_number is_plain="true"]', '[yaymail_billing_first_name] [yaymail_billing_last_name]' ); $additional_text = __( 'Thanks for reading.', 'woocommerce' ); $default_elements = ElementsLoader::load_elements( [ [ 'type' => 'Logo', ], [ 'type' => 'Heading', 'attributes' => [ 'rich_text' => $email_title . ' #[yaymail_order_number is_plain="true"]', ], ], [ 'type' => 'Text', 'attributes' => [ 'rich_text' => '
' . $email_text . '
', ], ], [ 'type' => 'OrderDetails', ], [ 'type' => 'BillingShippingAddress', ], [ 'type' => 'Text', 'attributes' => [ 'rich_text' => '' . $additional_text . '
', 'padding' => [ 'top' => '0', 'right' => '50', 'bottom' => '38', 'left' => '50', ], ], ], [ 'type' => 'Footer', ], ] ); return $default_elements; } public function get_template_path() { return yaymail_get_template( 'emails/admin-cancelled-order.php', '', YAYMAIL_PLUGIN_PATH . 'templates/' ); } }