I want to add a message based on the shipping method ID in the WooCommerce customer completed order email notification.
I am using following code:
add_action ('woocommerce_email_order_details', 'custom_email_notification_for_shipping', 5, 4);
function custom_email_notification_for_shipping( $order, $sent_to_admin, $plain_text, $email ){
// Only for "completed" email notification and "Local Pickup" Shipping Method
if ( 'customer_completed_order' == $email->id && $order->has_shipping_method('local_pickup') ){
$order_id = $order->get_id(); // The Order ID
// Your message output
echo "<h2>TEST</h2>
<p>Shipping info test</p>";
}
}
This works but I have 2 different local pickup
- local_pickup:10
- local_pickup:11
Is to possible to set this to only local_pickup:10?