I have created custom module and override contact-us email template. Also, I have changed contact us email type and set html. It's working perfectly. But the problem is when I received email, email header and footer are missing. Logo is not displayed.

Magento version 2.1.7

Here is my code.

module.xml should be [Vendor/RewriteContact/etc/module.xml]

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_RewriteContact" setup_version="2.0.0">
            <module name="Magento_Contact"/>
    </module> </config>

email_templates.xml should be [Vendor/RewriteContact/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="contact_email_email_template" label="Contact Form" file="submitted_form.html" type="html" module="Vendor_RewriteContact" area="frontend"/>

submitted_form.html should be [Vendor/RewriteContact/view/frontend/email/submitted_form.html]

 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
<!--@subject {{trans "Contact Form"}} @-->
<!--@vars {
"var data.comment":"Comment",
"var data.email":"Sender Email",
"var data.name":"Sender Name",
"var data.telephone":"Sender Telephone",
"template config_path=\"design\/email\/footer_template\"":"Email Footer Template",
"template config_path=\"design\/email\/header_template\"":"Email Header Template"
} @-->
{{template config_path="design/email/header_template"}}
{{trans "Name: %name" name=$data.name}}
{{trans "Email: %email" email=$data.email}}
{{trans "Phone Number: %telephone" telephone=$data.telephone}}

{{trans "Comment: %comment" comment=$data.comment}}
{{template config_path="design/email/footer_template"}}
  • did you run all this commands in order??. php bin/magento setup:upgrade, php bin/magento setup:di:compile, php bin/magento setup:static-content:deploy, php bin/magento indexer:reindex, php bin/magento cache:flush Commented Sep 12, 2017 at 14:29
  • Yes, I have run all command Commented Sep 12, 2017 at 14:32
  • Hi @Vishal Bariya, did you find solution of you problem. I am also facing the same problem. Commented Sep 14, 2017 at 13:33
  • Hi @Mohit Kumar Arora, I have try many But can't find solution. Commented Sep 18, 2017 at 4:32

1 Answer 1


Although this is not a proper solution; after too much debugging, I fixed the issue by the below process:

  • Create a new template for Contact Us email from Marketing > Email Templates.
  • Check the preview of the template and open page source of the template preview page.
  • Copy HTML source of the portion in which email template content is being shown.
  • Put the copied source into email template and replace the dynamic content with respective variables again.
  • Save the template and apply it from Stores > Configuration > General (Contacts) > Email Options.

Now try it from the frontend. I hope it would help you also.

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.