Untitled
unknown
plain_text
2 years ago
860 B
7
Indexable
add_action('b2bking_after_pending_quote_order_sent', function($order){
$to = 'test@gmail.com';
$subject = 'New Order Awaiting Shipping Quote';
$headers = array('Content-Type: text/html; charset=UTF-8');
$message = '<h1>Order Details</h1>';
$message .= '<p>You have a new order that requires a shipping quote. Below are the order details:</p>';
$message .= '<ul>';
foreach ( $order->get_items() as $item_id => $item ) {
$product = $item->get_product();
$message .= sprintf('<li>%s x %d - %s</li>', $product->get_name(), $item->get_quantity(), wc_price($item->get_total()));
}
$message .= '</ul>';
$message .= '<p>Please upload the shipping quote to the following link: <a href="site.com/link">site.com/link</a></p>';
// Send the email
wp_mail( $to, $subject, $message, $headers );
}, 10, 1);Editor is loading...
Leave a Comment