Woocommerce new order email to customer

In WooCommerce, you can customize the new order email sent to customers by modifying the woocommerce_new_order_email filter. Here's a step-by-step guide:

Method 1: Using the WooCommerce settings

  1. Log in to your WordPress dashboard and navigate to WooCommerce > Settings.
  2. Click on the Emails tab.
  3. Scroll down to the New Order section.
  4. Click on the Edit button next to New Order Email.
  5. In the Email Template field, you can modify the email template using HTML and WooCommerce placeholders (e.g., {order_number}, {order_total}, {customer_name}, etc.).
  6. Click Save Changes.

Method 2: Using a plugin

  1. Install and activate a plugin like WooCommerce Email Customizer or WooCommerce Email Templates.
  2. Configure the plugin to modify the new order email template.

Method 3: Using code

  1. Add the following code to your theme's functions.php file or a custom plugin:

    function custom_woocommerce_new_order_email($order, $sent_to_admin, $plain_text) {
     // Modify the email template here
     $email_template = '<p>New order received!</p>';
     $email_template.= '<p>Order Number: '. $order->get_order_number(). '</p>';
     $email_template.= '<p>Order Total: '. $order->get_total(). '</p>';
     $email_template.= '<p>Customer Name: '. $order->get_billing_first_name(). ' '. $order->get_billing_last_name(). '</p>';
    
     return $email_template;
    }
    add_filter('woocommerce_new_order_email', 'custom_woocommerce_new_order_email', 10, 3);

    In this example, we're modifying the email template to include the order number, total, and customer name.

Tips and Variations

Remember to test your modified email template to ensure it's working as expected.