lue); } } $formatted_attributes = !empty($attributes) ? implode(', ', $attributes) : ''; $replacements[] = [$product_name, $item_qty, $formatted_item_total, $formatted_product_price, $product_image_url, $product_sku, $formatted_attributes]; } $html = \EmailKit\Admin\Emails\Helpers\Utils::order_items_replace($html, $replacements); // Order details array for email $details = $details = Utils::woocommerce_order_email_contents($order); $message = str_replace(array_keys($details), array_values($details), apply_filters('emailkit_shortcode_filter', $html)); $currency_symbol_position = get_option('woocommerce_currency_pos'); if($currency_symbol_position == 'left') { $message = Utils::adjust_price_structure($message); $message = preg_replace_callback( '/(]*>.*?<\/del>\s*]*>.*?<\/u>)<\/span>\s*([\d.,]+)<\/bdi><\/span><\/span>/', function ($matches) { // Return only the del and ins tags without the extra price return '' . $matches[1] . ''; }, $message ); } else if($currency_symbol_position == 'left_space') { $message = preg_replace_callback( '/(]*>.*?<\/del>\s*]*>.*?<\/u>)<\/span>\s* [\d.,]+<\/bdi><\/span><\/span>/', function ($matches) { // Return only the del and ins tags without the extra price return '' . $matches[1] . ''; }, $message ); $message = Utils::adjust_left_space_price_structure($message); } $to = $order->get_billing_email(); $pre_header_template = get_post_meta($query->posts[0]->ID, 'emailkit_email_preheader', true); $pre_header = str_replace(array_keys(Utils::transform_details_keys($details)), array_values(Utils::transform_details_keys($details)), $pre_header_template); $pre_header = !empty($pre_header) ? $pre_header : esc_html__("partially refunded", 'emailkit'); $subject_template = get_post_meta($query->posts[0]->ID, 'emailkit_email_subject', true); $subject = str_replace(array_keys(Utils::transform_details_keys($details)), array_values(Utils::transform_details_keys($details)), $subject_template); $subject = !empty($subject) ? $subject . ' - ' . $pre_header : sprintf( /* translators: 1: customer full name, 2: order ID. */ esc_html__( '%1$s, Your order#%2$s has been Partially refunded', 'emailkit' ), esc_attr($order->get_billing_first_name() . " " . $order->get_billing_last_name()), esc_attr($order_id) ) . " - " . $pre_header; $headers = [ 'From: ' . $email . "\r\n", 'Reply-To: ' . $email . "\r\n", 'Content-Type: text/html; charset=UTF-8', ]; wp_mail($to, $subject, $message, $headers); } } }