I have a custom module that needs to overwrite the new order email template, the location for the default email template is


and this file get the data from


I need to override these two files from my custom module but I don't know how to do it

  • 1
    You can overrider email template using your custom theme Magento_Sales/email/order_new.html and block file using di.xml file Commented Feb 8, 2017 at 7:20
  • @Rakesh how to do it in custom module?
    – simple guy
    Commented Feb 8, 2017 at 7:24
  • 1
    for email template i dont know how to override using custom module. Commented Feb 8, 2017 at 7:27
  • I found that the best way to do this is through an event observer. More details in the accepted answer here: magento.stackexchange.com/questions/159142/… Commented Nov 8, 2017 at 16:58
  • @David, were you able to change the sales order email template by overriding in custom module? If so then please share the code snippet, I need to do the same but unable to achieve it
    – Shireen N
    Commented Jul 18, 2018 at 9:47

3 Answers 3


Your override file path is incorrect.

You have to just override order_new.html file at below location.


Clear & Flush the Cache by using below command:-

sudo php bin/magento cache:clean
sudo php bin/magento cache:flush

You can overwrite email templates in a module like this:

  1. Create Vendor/Module/etc/email_templates.xml

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
        <template id="sales_email_order_template" label="Vendor New Order" file="sales/order_new.html" type="html" module="Vendor_Module" area="frontend"/>
  2. Put your template in Vendor/Module/view/frontend/email/sales/order_new.html

  3. Make sure that your module is loaded after original Magento_Sales module by adding dependency in Vendor/Module/etc/module.xml

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
        <module name="Vendor_Module">
                <module name="Magento_Sales"/>

Create the order_new.html file in your module, path:app/code/{VendorName}/{PackageName}/view/frontend/email/

And do your customization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.