object instanceof WC_Order ) { return $email; } $order = $email->object; $order_date = $order->get_date_created(); $email->withdrawal_data = array( OrderWithdrawalFormProcessor::FIELD_FIRST_NAME => $order->get_billing_first_name(), OrderWithdrawalFormProcessor::FIELD_LAST_NAME => $order->get_billing_last_name(), OrderWithdrawalFormProcessor::FIELD_EMAIL => $order->get_billing_email(), OrderWithdrawalFormProcessor::FIELD_ORDER_NUMBER => $order->get_order_number(), OrderWithdrawalFormProcessor::FIELD_WITHDRAWAL_TYPE => OrderWithdrawalFormProcessor::WITHDRAWAL_TYPE_SPECIFIC, OrderWithdrawalFormProcessor::FIELD_ADDITIONAL_DETAILS => __( 'I would like to withdraw the first item from this order.', 'woocommerce' ), ); $email->submitted_at = $order_date ? $order_date->getTimestamp() : time(); $email->placeholders['{order_number}'] = $order->get_order_number(); $email->placeholders['{order_billing_name}'] = $order->get_formatted_billing_full_name(); if ( $email instanceof WC_Email_Order_Withdrawal_Requested ) { $email->matched_order = $order; $email->outside_withdrawal_window = false; $email->withdrawal_window_warning = ''; } return $email; } }