You’ve lovingly setup your first WooCommerce shop: picked out that perfect theme (maybe one we recommend), polished your product page content to an irresistible shine, tested your frictionless checkout, and… received a nice enough but totally generic order email that in no way matches the look, the style of your shop. This generic email doesn’t represent the impression you want to leave your customer with!

A common question from new shop owners is: how exactly do I customize the default WooCommerce order emails to either match my shop’s look and feel, or how do I add some additional content to assist customers with their order? While creating HTML emails is admittedly a specialty unto itself with a lot of complexities involved, WooCommerce offers some options that will allow the most novice to perform some basic tweaks, and if you’re comfortable with HTML, CSS, and even some PHP/WordPress development, there’s no limit to the customizations you can create.

Customer Emails

“Out of the box” WooCommerce includes 7 email types, 4 of which are sent to the customer and related to their order, these are the ones we’ll be concerning ourselves with (though any techniques can certainly apply to the other types):

  • Processing order – sent to the customer after payment and contains the order details.
  • Completed order – sent to the customer when the order is marked complete, and usually indicates that the order has been shipped.
  • Customer invoice – sent to the customer for an order which requires payment
  • Customer note – sent to the customer when a customer note is added from the edit order admin

In addition to the standard email types, you can add completely new and custom emails, though this is considered an advanced topic.

WooCommerce Global Email Options

The standard WooCommerce email looks like the following:

wc-customizing-order-emails-default-email

The WooCommerce admin allows some basic customization of this default email layout, with options found by logging into your WordPress Admin and going to WooCommerce > Emails > Email Options. Some of options include:

  • Set the “From” name/address that the customer sees
  • Add a header image
  • Change the email footer text
  • Choose different base, background, and body text colors

Keeping in mind that these configuration options will apply to all emails, and in just a few minutes we can start creating a custom branded look by setting a header image, custom footer text, and a new “base” color (yellow):

wc-customizing-order-emails-custom-email-1

Looking pretty good! If you’re following along closely you may notice that WooCommerce has detected that a “light” base color was used (the yellow) and automatically changed the title text color to black to provide an appropriate level of contrast. Cool! Unfortunately, the same was not done with the footer text, so this is something we will clean up later.

WooCommerce Email Specific Options

Each email type offers its own set of customization options. These can be found by going to WooCommerce > Settings > Emails > Processing order (for the processing order type, of course). Here you can further tweak the content for this particular email type, changing for instance:

  • Whether the email is even sent at all (enabled/disabled)
  • The email subject
  • Email heading (defaults to “Thank you for your order”)
  • Whether the email is sent as HTML or plain text (defaults to HTML)

Here we set a custom email heading “Thanks From Los Pollos”:

A custom email heading

A custom email heading

Overriding Email Templates

A more powerful (and advanced) way to customize order emails is to override an email template file. WooCommerce uses a convenient templating system that allows you to customize parts of your site (or emails) by copying the relevant template file into your theme, and modifying the code there. Each of the email types has a template file for its content (ie woocommerce/templates/emails/customer-process-order.php) along with a number of shared templates that are used for all emails types (ie woocommerce/templates/emails/email-styles.php). It is this latter which we will override to fix that hard-to-read footer text from before.

  • First you make sure that the following directories exist in your wordpress install: wp-content/themes/your-theme/woocommerce/emails/
  • Next, copy the file found at wp-content/plugins/woocommerce/templates/emails/email-styles.php into your theme at: your-theme/woocommerce/emails/.
  • Finally edit your-theme/woocommerce/emails/email-styles.php to change the footer text to black (only the relevant part of the template file code is shown, for brevity):
...
$credit = "
	border:0;
	color: black;
	font-family: Arial;
	font-size:12px;
	line-height:125%;
	text-align:center;
";
...

This gives us a much more readable footer:

wc-customizing-order-emails-customer-email-3

Conditional Customization with Actions/Filters

The final, and most powerful/advanced way to customize an email is to make use of the actions/filters provided by WooCommerce with some custom code. While this does require some comfort with simple PHP and the WordPress Plugin API, the benefit is that it’s more upgrade-friendly, as the original WooCommerce templates are still used: we’re just injecting/modifying some of the content. Makes sense? Great!

For this example we’ll add some helpful payment instructions to the email, based on the checkout payment type used. To try this out, add the following to your theme’s functions.php:

add_action( 'woocommerce_email_before_order_table', 'add_order_email_instructions', 10, 2 );

function add_order_email_instructions( $order, $sent_to_admin ) {
 
  if ( ! $sent_to_admin ) {

    if ( 'cod' == $order->payment_method ) {
      // cash on delivery method
      echo '<p><strong>Instructions:</strong> Full payment is due immediately upon delivery: <em>cash only, no exceptions</em>.</p>';
    } else {
      // other methods (ie credit card)
      echo '<p><strong>Instructions:</strong> Please look for "Madrigal Electromotive GmbH" on your next credit card statement.</p>';
    }
  }
}

When checking out using the “Cash on Delivery” method, the email received by the customer will include the helpful order instructions indicated below:

Custom payment instructions

Custom payment instructions

Other methods will include the “Please look for…” instructions instead.

Plugin/Payment Gateway Options

There are a few plugins/payment gateways that actually allow you to customize portions of the order emails. For instance, the built-in bank/wire transfer payment method allows you to configure instructions (containing your wire transfer into, etc) right from the WooCommerce > Settings > Checkout > BACS admin.

Although fairly uncommon, it’s good to be aware that these types of options can exist, when you’re choosing/configuring plugins for your site.

In Closing

In this article we covered five techniques available for customizing WooCommerce order emails, ranging from trivial admin configuration, to advanced action/filter usage. We took the clean but undistinguished default order processing email, and styled it to match our imaginary shop. If you found this material useful and put any of the methods described above into practice, or have one of your own, please let us know with a comment below!

Article Resources

Want to see more “How to” articles? We’ve got a whole category of them!


I'd like to give you our complete list of the best WooCommerce resources as a thank-you for reading. I've put together a list of my top themes, plugins, authors, and go-to sites. You can download it for free & join our VIP section:

Free Download
Articles you may also like:

Posted by Justin Stern

Justin is a cofounder of SkyVerge and a frequent Sell with WP contributor. He loves writing technical reviews and how-to articles, but thinks writing code is far easier than writing words.

100 Comments

  1. I changed my email footer text to black. Small changes like this really add up. Thank you very much for the helpful and easy to follow tutorial!

    1. Nice! Thanks for letting us know Bradley!

  2. HI!
    Nice tutorial, thanks for that.

    Maybe you could help me on something: I would like to receive with the new order e-mail (the one the admin receives) also a description of the product, instead of only it’s name.

    Any clues?

    Thanks!

    1. Hey there, the easiest way to do this would be to override the email order items template: https://github.com/woothemes/woocommerce/blob/master/templates/emails/email-order-items.php (tutorial on this: http://www.skyverge.com/blog/how-to-override-woocommerce-template-files/) and add in the info where you’d like. However, this will also include your new content in customer emails.

      For example, you could add the short description after the product name:

      // Short description
      echo $_product->get_post_data()->post_excerpt;
      

  3. Hey Justin, I’m very grateful for you post.

    I was wondering as I’m searching all over google and can’t find the answer. How on earth do you remove the price field from the customer email templates? I’ve tried removing the field and it didn’t’ work. I’ve been able to add other customizations just fine on my own like a timestamp, but having such problems with this price column. I found I’m not the only one who struggles with this problem and has had no luck fixing it.

    1. Hey Heather — you should be able to override the email-order-items.php template file and comment out this line to remove the price field πŸ™‚

  4. Hi Justin,

    Awesome post. Thank you for the tips. I’ve got a question maybe you can also help me with. I’m trying to remove and modify text that appears in the order breakdown. Specifically, I’d like to change the wording when a customer uses a coupon. Currently it says “Cart Discount: $XX.XX”. I’d like to change the “Cart Discount” wording to something else (“Coupon Applied”, for example), but I can’t for the life of me find the file / line that I need to edit! Any ideas on how to do this?
    Thank you!

    1. Hey Cameron, check out the Say What plugin – it lets you change any translatable text. You’d probably want to start here, but the domain for anything translatable should be woocommerce.

  5. Hello!

    Thanks for this nice article!

    I’d like to center the header text and also change the text content of all the emails notifications.

    Can you please help me?

    1. Hey Shanty, thanks for the question. To change CSS styling like the header text alignment, and content copy, you’ll want to follow the instructions to override email templates

      1. Great! Thank you i missed this part indeed!
        Let’s go back to work!

  6. Hi Justin, thank you for posting this awesome article! I am excited to try some of your tips. I was wondering if you might know how I could create a new email template to be sent out to customers who purchased a product from a certain product category. I would probably duplicate one of the existing email templates such as the completed order template, but I don’t know which line to change so it will get sent out to a customer who has a completed order within a specific product category. For us, it is the “waiting list” category.

    1. Hey there, I’d recommend checking out this tutorial and reading through, as it provides a good overview of how to set up an email: http://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/. Instead of triggering new emails based on shipping method, you could loop through the order line items and check for product category, then tweak the rest of the setup to reflect your email type. If this isn’t something you’re familiar with, you could get someone from Codeable or Elto to customize it in less than an hour.

  7. Thanks for your great article!!!
    Maybe you can help me with another one: I would like to receive with the admin-mail the payment method.
    Do you know how this works?
    Thanks!

  8. Hi There,

    thanks for all the tips. I am trying to find a way to change the TEXT of the email that is sent by wc. For example when I confirm the order it says: “your oder is completed”. I would like it to to say: “your order has been shipped”. Does anyone know where to find an answer on that?

    Thanks

    1. Hey Paul, you can check the subject within the settings, but would have to override the templates referenced here to change the email content. You can override them as described in the Overriding Templates section.

  9. Hi there, thank you for the article.

    Is there a way of deleting the Price from the order email that is sent to the customer. My client does not want to show any monetary value on the email.

    Thank you

    1. Hey Brian, you can certainly remove the price from the order emails, by overriding the WooCommerce template files woocommerce/templates/emails/email-order-items.php, woocommerce/templates/emails/customer-process-order.php, and woocommerce/templates/emails/customer-completed-order.php and removing the portions that display the item subtotal $order->get_formatted_line_subtotal( $item ) and totals in the order item table footers $order->get_order_item_totals(). Do this by copying the files to your-theme/woocommerce/emails/ and making the edits. Hope this helps!

      1. I do not see this $order->get_formatted_line_subtotal( $item ) in the files you mentioned. Please advise.

  10. Hey Justin

    Thank you for your reply….When I applied the changes as you suggested and then went to make an order the checkout page seems to freeze, it just has a spinning icon and does not do anything else.

    The process in which I made your suggested changes was:- Woocommerce – Settings – Emails – New Order option – view template – deleted the line as you suggested – Save changes.

    Is there something I am doing wrong???

    Thanks

    Brian

    1. Hey Brian, well first off the “New Order” is actually the admin email, so you’ll want to be working with the “Processing Order” and “Completed Order” ones which are sent to the customer. I don’t believe you can edit those templates from the “view template” area; did you use the “copy file to theme” option and edit there? Regardless, any changes to those templates are unlikely to freeze the checkout page, though you could reverse the change you made and place another test order to verify that.

  11. I used the “copy file to them” option but I cannot find the file to edit within the theme. Should it be in the them’s editor that I do this. I am really stuck now!!! Any help would be greatly appreciated.

    Thank You
    Brian

    1. Hey Brian, if the theme’s editor isn’t showing these files, you can edit them via FTP instead. Here’s an overview of how to do so from WordPress.org and a good tutorial from WP Beginner.

  12. Hi Beka

    Thanks for getting back to me and thanks for the tutorials. I had uploaded woocommerce to my site as a plugin so I am assuming that is why the themw editor isn’t showing the files. Do I have to de-activate woocommerce plugin or can I just ftp the relevant files??

    Thanks again for your help

    Regards

    Brian

    1. Hey Brian, you’ll actually want to edit the files that have been copied to your theme now instead. Via FTP, you’ll go through these folders: your theme > woocommerce > emails and the template files will now be inside this folder. This way, they won’t be overridden if you upgrade WooCommerce. For example, I’d locate the files in `twentytwelve-child > woocommerce > emails` on my test site. If you haven’t copied over the templates already, you can just put the edited template files here.

  13. Hey Beka

    Thanks for getting back again…Do I still need to FTP the Files to the theme. When I check the Theme Editor there is no mention of woocommerce anywhere!! I uploaded woocommerce to the site as a plugin. Sorry for my ignorance in relation to this, I’m just not too sure what way to do this.

    Again, thank you for all the help and guidance

    Regards
    Brian

    1. Hey Brian, correct, WooCommerce will be under plugins. However, if you create a `woocommerce` folder in your theme, WooCommerce will check for this to let you override templates, and will use the template files there instead of its own. That’s why we’ll be putting the override in the theme instead with a `woocommerce` folder, then an `emails` folder inside of it. This tutorial has a good overview πŸ™‚ .

  14. Thank you for your great tutorial!

    I was wondering if you know how to have woocommerce send a different email to the customer based on which payment type they have selected?

    For example, if customer selects pay via credit card, then email template #1 would be sent to them upon checkout completion. If customer selects pay via paypal, then email template #2 would be sent to them. Etc…

    1. Hey there, this tutorial on custom emails is a good place to start. It uses a custom email based on shipping method, but you could use it as a starting point for an email based on payment method.

  15. Hi there. First of all, thank you so much for the article.

    I’m wondering if it’s possible to have a conditional statement for each product. I’ve been trying to figure this out for days now.

    For example:

    If the person purchases product A, the email will say “Instruction: Go to LINK A”
    If the person purchases product B, the email will say “Instruction: Go to LINK B”

    I’d appreciate the help.

    Thank you,
    Adrian

    1. Hey Adrian, this is possible, but would require a fair bit of custom code. I typically recommend Elto or Codeable for these sorts of jobs.

  16. Hi! Great Post!
    I really need your help!

    Is there any possibility to hide a specific variation on email notification?
    I mean: I use as variations such as sizes, colors and I want them, but I also use a variation for warranties that I don’t want to see on the emails.

    Please, I’m looking all over the internet but I Can’t find anything!
    Thank you.

    1. Hey Mattia, anything is possible with custom code πŸ™‚ . However, this isn’t exactly a straight forward change – this filter would be the place to start, but you’d have to hook into it, determine whether you’re actually in an email or not (which is probably the toughest part), then make your changes to remove these variation ids. If this isn’t something you’re familiar with, I typically recommend Elto or Codeable for these sorts of jobs.

  17. Hi!
    I was checking your post and i’m not able to find the customisation i’m looking for, maybe you guys could give me a hand.
    I want to delete the header where it repeats the subject i attach photo: http://s18.postimg.org/xuycvekeh/headerwoomail.png
    I just want to leave my custom header image that i uploaded and delete this horrible header that it is only repeating the e-mail subject…

    And also, will it be possible to delay lets say 5 minutes the “processing order” mail?

    Thanks so much for your help! πŸ˜‰

    1. Hey Carl, it’s not possible to remove that section completely since other parts of the template are added when it’s added. However, you can change the text for it in the email settings for each email. There’s no easy way to delay the emails I’m afraid.

      1. Hi Beka,

        thanks for your quick answer πŸ™‚
        How can i change the text size of that part to make it smaller (i think is horrible an useless to repeat the subject in such a big font…) ?
        I wanna change it for ALL templates(complete, processing order,…), will i need to go 1 by one to do this?

        The delay thing it is because i have setup a second emails with other details through “Follow-up emails plugin” and this email needs to get before the other but it is always getting later πŸ™ any advice?

        Thanks again for your time and your help .

        1. Well you’d have to override the email template as described here to change anything about the font, so if you’re doing that already then you may as well delete the “Header” portion instead – Line 94-102 (you try to avoid overriding them as possible in case templates change in the future). This will apply to all emails. You’d want to override this template within your theme.

          The delay thing would be possible with custom code, but definitely fairly challenging. My advice would be to hire someone to do it for you πŸ™‚ .

  18. Hi all… I want to add to the subject line the clients name.. so it says New Order From John Doe. Makes finding them in my email folder easier.

  19. Hi ,

    Thanks for the awesome post.

    I have a question to ask. Is it possible to display certain text in email based on the category of the product purchased ? If so, How can I do that.

    Thanks

    1. Hey dinesh, this is certainly possible! It takes some custom coding though, so I’m going to assume a certain familiarity with PHP/WordPress development in order to keep the answer reasonably brief. First you want to either override the template file for the email you want to alter, or view the template file and identify an action hook to use if you can just add the content. Either way, from the overridden template, or from the action call, to check whether a product has the category ‘clothing’ you’d use a check like this: if ( has_term('clothing', 'product_cat', $product->id) ) { // display your content here. Hope this helps!

  20. Hi Justin! Do you know how we’d go about emailing order notifications of placed orders to more than one email address at a time? For example, a customer of ours wants a copy of their order sent to them and also to someone in the billing department. They don’t have a group email address for us to send to.

    Is there a plug in to do this? Something that doesn’t get overwritten every time WooCommerce updates?

    1. Hey Jonathan, there’s nothing “off the shelf” that I’m aware of, though it would be fairly easy to put together with a little custom coding. You just need to find the id of the email you want to send to multiple recipients, and then add the other email addresses when appropriate (by original order recipient email, customer id, whatever). I’ve put together a small sample code snippet to hopefully get you started: https://gist.github.com/justinstern/1003d98afd109565b610

  21. We have launched a plugin called Email Control for WooCommerce (on CodeCanyon) that does what some of you are discussing in this thread – it allows you to customize the styling, colors, logo, and what the text says in the emails sent from your WooCommerce store, using the familiar WordPress Customizer interface. We created the plugin for our store as we needed more control over what the text in our emails said and wanted their design to look more professional and unique. We think the plugin could be a solution for some of you here.

    1. Sound’s great i will definitely try out!

  22. Hey guys, Fantastic tutes.. Learning a lot. Have 2 things I need help on. First: Need to add Brand Name to the Product Name in my Invoice emails. Brand Name is a separate field in my site (i haven’t built it) How do i hook this in to the invoices?

    Second, How can i add Order Date next to Order Number.? I have tried to use the same line of code that pulls the Order Number and just changing the get_Order_Number to get_Order_Date

    Which is the same way the Order Number is pulled, but it returns as a Fatal Error..

    Any help appreciated! Thanks..

  23. Hi Guys,
    I need to change this so that it sends 1st text if it is a certain woocommerce category otherwise sends 2nd text.

    basically need the line
    I hope you can help.
    David

    1. Hey David, this would be a bit more complicated / require a bit more code, but you could probably do so by retrieving the items in the order, looping through the order items, and doing a check to see if the category is present for any of the items.

  24. Nice article for customizations, but how does one “add some additional content to assist customers with their order? ”

    I just need to add some text to the outgoing emails. Something that should be really really easy.

    WooC provides a field for a custom footer why don’t they just provide a field for a custom message?

    Thank you.

    1. Hey Michael, you could either do this via the woocommerce_email_before_order_table action and add your own text here, or check out the Email Customizer plugin mentioned above.

  25. Widget / $50 / 2 / $100
    This might be the simplest thing in the world… Over in the Advanced WooCommerce Facebook group (https://www.facebook.com/groups/advanced.woocommerce/) a guy was asking how he could customize the emails that HE receives so that they contain all the information he needs w/out having to go back to his dashboard. In other words, he can’t be running back and forth between emails and dashboards. He just simply needs to get the pertinent information in an email. Got it? Ok, so we open up the admin email https://gist.github.com/BurlesonBrad/8eb1dbf52fe5c8df1eef#file-wooadminemail-L29 Now, shimmy on down to line 29. See the word ‘STEVE’? What he’s needing is this https://bradgriffin.me/steve-email.jpg

    So, what can we tell him to do to get the original price of the item into his admin email? Thanks! -Brad He just sent a message that said “the pdf invoicer shows it perfectly” along with this screenshot https://bradgriffin.me/steve-email2.jpg

    1. You could check into the email-order-items template, as I’m pretty sure this generates that table and could be used to add another column.

  26. Thanks Beka. I’m actually looking for the actual code to add πŸ™‚ (not just ‘where’ to look)

    Check out the comment again, and you’ll see a few gists. (I’m guessing that I should have manually linked all of them in the comment above ~ sorry!) You’ll see that we already have the ‘where-to-look’ part. What he’s needing is the actual variable / string / or field that will output the original price of the item.

    Any idea what that ‘variable / string / field’ would be?

    1. Not off the top of my head, but this would be a good fit for Codeable if you don’t work with a dev already.

  27. Hi,

    thanks for artile. I use topic Conditional Customization with Actions/Filters. Problem is that my language have chars like Ε‘, Γ‘, č, Ε₯ etc. and this chars are missing in email. do you have some solution?

    Marek

  28. […] IfΒ you’re using WooCommerce, check out our Email Customizer extensionΒ — it will get you started on changing the visual aspects of your emails so that they match your branding. A great tutorial on making a few additional changes by hand can be found here. […]

  29. Hi, I read your posts because they seek a solution for the client. Very surprised that the Woocommerce fail to set the information that have come up email after the goods ordered.
    Specifically, this is a shop with wine (my first shop: o) – I need for each ordered item also add marking wine producers, not just the name of the variety:
    Cabernet Sauvignon – Mrva & Stanko
    Cabernet Sauvignon – Vinanza

    Nowhere have I found ways to do it. I label wine producers for products defined under category of product.

  30. Hi Justin,

    On my webshop, an option is to pick up the goods by themselves at our warehouse. When a visitor has chosen this option, I want to add a line with the address and openings hours of our warehouse.

    What code can I use if I want to add a line when the visitor has chosen a certain shipping method?

  31. Hi
    thanks so much – exactly what I was looking for to finalize our new store for our business services, moving to WooCommerce. Needed to have two messages to client about the credit card billing and also a reminder as to URL to go to in order to submit porject.

    One question:
    in your example for functions.php will changing the method ‘cod’ to ‘echeck’ work ? We want to add note about check taking 2-4 days to clear and not have a COD note.

    e.g.

        if ( 'echeck' == $order->payment_method ) {
          // echeck method
          echo 'Instructions: Please allow 2-4 working days for echeck to clear before services can be provided. Thank you..';
        } else {
          // other methods (ie credit card) ...
    (etc)
    

  32. Hi, please i’m tryng to change the object of email in new order in:
    New reservation for – {item_name} – of {order_date}
    where {item_name} is the product name.
    I have tried {item_name} but i’m not shure it exist!
    Any help about?
    thanks

  33. I have a client (who is the admin) who does NOT want email notifications every time a user resets a password, creates a new account, etc. How do I prevent email notifications like this?

    I guess I’m unclear when the “enable/disable” email notification box is checked, who is it sending to? The customer or the administrator? We obviously want the customer to get emailed the information they need, the admin just doesn’t need to be notified when someone looses a password or creates a new account.

    If it is not the administrator, how do I stop email notifications getting sent?

    1. Hey Molly, these emails are not from WooCommerce; WordPress itself always sends these notifications for new users / changed passwords. You can disable new user notifications with this and disable password change emails with this.

  34. Hi,
    How can i add bank details into order completed email beside your details and bellow of order table.
    Thanks,
    murad

  35. Hello, thanks for your post.
    Im talking from Brasil, and here we use a plugin to get payments with credit card with CIELO. Im found your post because im looking a way to get a name of the credit card sending with the email order. Im trying your suggest, but no lucky, or maybe not to much knowledge about it! πŸ™
    So, any help to how get the name of the credit card sending in the email order?
    Sorry for my bad english…

  36. Thanks so much for the e-mail customization tips. This is one thing that every web developer I have talked to knew nothing about. I wonder why WordPress makes it so difficult to customize? I mean, they allow for customization of almost everything else without the need to actually alter the code. Do you know if there is a plugin that can do this? Just looking for an easier option.

    Thanks!

  37. Hi,
    could you let me know how to only have the extra info be displayed in the customer’s processing-order. email, not any other emails and not the admin email?
    Thanks!

    1. Quickest way would be to override that email template only

  38. Hi Beka,
    thank you but this does not work because I only need the text when Paypal is chosen as the payment method. I am using a plugin that is adding a “Pay now”-button that is linking to Paypal in that email, and I want to add some text like “If you have not paid yet, please use the link below”. I know the plugin is using this hook

    add_action( ‘woocommerce_email_before_order_table’, array( $this, ’email_pay_now_button’ ), 0, 1 );

    but I am very new to this and don’t know how to add the text above the link.

  39. I have looked everywhere but cannotfinda solution to how to also send the cancelled-order email to the customer and not only to the admin…could you help me with this? Thank you so much.

  40. THANK YOU!! This is such a helpful tutorial! I am wondering for the part where you add a custom function to echo some html… I’d like to do something like this. Probably will add a bit more text. But I’m wondering, is there a way to edit/delete the specification depending on payment method? I just want to add instructions for next steps that I want to send to every purchase processing order. If you have any advice, I’d greatly appreciate it!

    1. Sure, the section here conditionally adds text based on payment method. If you wanted to check for more methods you could definitely do so, or only add this for some methods but not others. Codeable is a great source for small jobs like this πŸ™‚

  41. Hello for this helpfull tutorial. I am wondering if there is a way to receive a copy of the customer’s invoice or an email to see that a customer has bought a product.
    Because right know, the only way to see if someone has bought a product, is going to Woocommerce -> Orders. But I would like to receive an email with this information.
    Thank you

    1. WooCommerce > Settings > Emails > New Order should do the trick, you may have it disabled.

  42. Hai do you know how to make BACS gateway to send a new order email to a customer instead of the processing email?

    Thank you

  43. I’m using woocommerce 2.4.12 and I’ve entered the text I’ve wante dfor the email footer but when it sends an email the text from teh footer is not there. Icopied the email files over to the customizing folders as described but they still don’t send out the custom footers text I need. Any help would be appreciated.
    Thanks

  44. Hello,
    I want to add product details and itinerary in order emails (like pdf or text).
    Is it possible?

    1. Sure, there are definitely enough hooks to add further details to emails. The order details template is probably the best place to get started, as these hooks will let you add information right before or right after the order information, and they pass the $order object to the hooks so you can get order and product information for your custom code.

      1. Thank you for your reply. But i don’t know about more information about code :(. Can you help me about this? I just want to add product details in order mail.

        1. Hey Emre, I don’t have any sample code already done for this and it will depend on what specific details you’d want, so I’d recommend checking out Codeable πŸ™‚

  45. Hi! Thanks for this. It works well on first test. I’m using the function.php sample mentioned but this adds the conditional text to both the processing and completed email. I’d like to enter similar code in the template files directly for more customisation but I’m not sure how to alter the sample if it isn’t going in functions.php. Would I simply leave out the add_action & function lines? ie; only use:

    if ( ‘cod’ == $order->payment_method ) {
    // cash on delivery method
    echo ‘Instructions: Full payment is due immediately upon delivery: cash only, no exceptions.’;
    } else {
    // other methods (ie credit card)
    echo ‘Instructions: Please look for “Madrigal Electromotive GmbH” on your next credit card statement.’;
    }
    }

    Thanks again for your help!

    1. yep, if you’re going right into the template you shouldn’t need those bits since you’re not hooking into the template. Always test on a staging / local site first though!

      1. Thanks Beka. Works great! One more quick one. How would I go about setting a similar conditional for the quantity? I have a message to send to users how purchase more than one of any item (same item. not two seperate items). Something like:
        if ( 1 < $order->qty ) {
        I was looking for the quantity or similar tables but can’t find anything. Cheers!

  46. Hi! I’m trying to do something similar, but instead of COD, I’d like there to be a specific instructions when a customer chooses “Local Pickup” for their shipping method.

    I tried this but it didn’t work:

    function add_order_email_instructions( $order, $sent_to_admin ) {
      if ( ! $sent_to_admin ) {
    
        if ( 'local_pickup' == $order->shipping_method ) {
          // Local Pickup
          echo '<p><strong>Instructions:</strong> These are the local pickup instructions.</p>';
        } else {
          // other methods (ie table rates)
          echo '<p><strong>These are the instructions for everything else</p>';
        }
      }
    }

    1. There’s no shipping_method class member for the order abstract like that since there can be multiple methods per order (whereas there’s only one payment method per order). You’d need more additional code to get the array of shipping methods, then check to see if the method you want is in that array to add your notices.

      1. Okay, thanks! I’m a newbie, so I don’t know how exactly to add that code, but I will try to figure it out πŸ™‚

      2. I was able to do it using:
        ‘Local Pickup’ == $order->get_shipping_method()

        So glad it works!

  47. Hi

    I would like to attach two pdf files to the new order email for administrative purposes. Each pdf file is associated with a component product and stored as product custom fields. I have a function which picks up the relevant file paths depending on which composite product (and therefore the component products) have been ordered. I have the full pathnames in an array but cannot work out how to get the new order template to actually physically attach the files. Do I have to explicitly run the action in the template or should it happen automatically as the filter is set to work on ‘new_order’ emails.

    1. Afraid I haven’t worked with attachments myself — may be worth picking up the WooCommerce Email Attachments plugin to see how they handle this sort of thing.

  48. Is it possible to send payment or credit card details ? I am using authorize.net for payments in woocommerce.

  49. Hi
    thx in advance.
    Now i have down email the notice Customer detail. email.
    i l also put the Billing details bcz my developer has delete the Billng details on page check out so i dont see it and also in invoice with many plugns i tested.
    Can you give an davice for my developer?
    Thx .
    BR

  50. Hi! What a useful and helpful tutorial!
    I was hoping to find some code or a tutorial: I would like the “new order” emails sent to a certain email address if the customer has ordered one specific category.
    Do you have any suggestions how I might go about this?
    Thank you in advance!

    1. Hey petradr, there are filters in place that would let you add recipients to the email conditionally, but I don’t have any sample code around doing so for product categories. This tutorial is a starting point, and you or your developer could customize it further to add the category check.

  51. Nice article!
    But I find it a little bit difficult here,
    maybe the same problem like Juan does.

    When customer put an order to my site, Woocommerce sent an email containing the templates from customer-processing-order.php. After I change order status from “pending” to “processing”, Woocommerce sent an email to customer again, also using the template from customer-processing-order.php.

    I want Woocommerce send different e-mail for “New Order” and when order status changed to “Processing”. I can’t find the templates for the template anywhere.

    Do you have any suggestion or advice for my problem here?
    Many thanks!

  52. Hello,

    Great post. I’ve managed to do everything except for some reason i cannot get the logo to center as you have yours. I’ve tried editing multiple aspects in the email style sheet, headers, etc with no luck. I’m sure it’s probably something simple but i can’t seem to be able to find it.

    If you could please let me know which part needs to be edited to center the logo that would be great.

    Thanks,
    John

    1. hey John, it’s centered by default, I’d check to make sure you’re not modifying the template or CSS at all to change it.

  53. I understand very clearly how to override customer-processing-order.php (by placing it in my child theme)

    Is it possible to somehow override WC_Email_Customer_Processing_Order.php in a child theme?

    If so, what would the folder structure look like for this? Where exactly would this file be placed in the child theme?

    Thanks!

    1. Hey Gerald, you can’t override classes the same way. You could extend the class to override some of its methods (if public or protected), but this requires far more familiarity with PHP.

      1. Hi Beka – thanks for clarifiying! : )

It's been over 2 years since this post was published, so comments have been closed. Thanks for reading!