Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon Is it possible to send different tracking information emails based on order status


Is it possible to send different tracking information emails based on order status


Yes, it is possible to send different tracking information emails based on order status in WooCommerce. Here are a few methods to achieve this:

Using Plugins

1. Advanced Shipment Tracking for WooCommerce

This plugin allows you to customize tracking emails based on different order statuses. You can configure it to send tracking emails when an order is marked as "Shipped" or any custom status you create. The plugin supports multiple shipping carriers and allows you to add tracking numbers easily.

- Custom Order Statuses: You can create custom statuses (like "Shipped") and set the plugin to send tracking emails when the order status changes to this custom status. This way, you can control when and how tracking information is communicated to customers[4].

2. WooCommerce Orders Tracking

This plugin also provides the functionality to send tracking emails based on order status changes. You can set it to send emails when the order status is updated to "Shipped" or any other custom status you define. It allows for easy customization of email content, including the use of shortcodes to personalize the message[2].

3. FunnelKit Automations

FunnelKit allows you to set up automated emails based on specific triggers, including order status changes. You can define conditions such as sending a tracking email when an order status changes from "Processing" to "Shipped." This gives you flexibility in managing customer communications effectively[3].

Custom Code Solution

If you prefer a more tailored approach, you can add custom code to your theme's `functions.php` file to send different emails based on order status. This involves hooking into WooCommerce's email actions and specifying conditions for sending emails with tracking information.

Example Code Snippet

php
add_action('woocommerce_order_status_changed', 'send_custom_tracking_email', 10, 4);
function send_custom_tracking_email($order_id, $old_status, $new_status, $order) {
    if ($new_status == 'shipped') {
        // Prepare your email content
        $to = $order->get_billing_email();
        $subject = 'Your Order Has Shipped!';
        $message = 'Your tracking number is: ' . get_post_meta($order_id, '_tracking_number', true);
        
        // Send the email
        wp_mail($to, $subject, $message);
    }
}

This code sends a custom email with tracking information when the order status changes to "shipped."

By utilizing these plugins or custom coding, you can effectively manage and send different tracking information emails based on the order status, enhancing customer communication and satisfaction.

Citations:
[1] https://stackoverflow.com/questions/74049095/how-to-woocommerce-dont-send-email-after-order-status-set-to-completed
[2] https://fr.wordpress.org/plugins/woo-orders-tracking/
[3] https://funnelkit.com/woocommerce-shipment-tracking-emails/
[4] https://wordpress.org/plugins/woo-advanced-shipment-tracking/
[5] https://www.reddit.com/r/woocommerce/comments/1bkfbaq/how_to_send_customers_email_about_shipment_and/