1

In continue with

Magento 2: How to change Contact Us Email Type?

I have set my new template for Contact Us.

{{template config_path="design/email/header_template"}}

<table>
    <tr>
        <td>{{trans "Name: %name" name=$data.name}}</td>
    </tr>
    <tr>
        <td>{{trans "Email: %email" email=$data.email}}</td>
    </tr>
    <tr>
        <td>{{trans "Phone Number: %telephone" telephone=$data.telephone}}</td>
    </tr>
    <tr>
        <td>{{trans "Comment: %comment" comment=$data.comment}}</td>
    </tr>
</table>

{{template config_path="design/email/footer_template"}}

When i "Preview Template" from Admin, then it's showing Header & Footer.

In the Email it's not showing. I already cleared cache & run all commands.

7
  • Make sure type of your template should be html in your email_template.xml
    – mp196
    Commented Jan 4, 2017 at 9:28
  • Yes its already html. In email i got as mentioned in question. Only header & footer missing
    – Jackson
    Commented Jan 4, 2017 at 9:30
  • The content showed correctly? Commented Jan 4, 2017 at 9:31
  • Then you should probably check the email template selected in backend for the contact us.
    – mp196
    Commented Jan 4, 2017 at 9:31
  • Yes @KhoaTruongDinh Content show perfect in HTML mode. For other email templates i'm using same header & footer & it works.
    – Jackson
    Commented Jan 4, 2017 at 9:32

1 Answer 1

2
<!--@vars {
"template config_path=\"design\/email\/footer_template\"":"Email Footer Template",
"template config_path=\"design\/email\/header_template\"":"Email Header Template"
} @-->

This will solve issue

7
  • are you added in custom template in magento backend right?
    – Ajay Patel
    Commented Jun 22, 2017 at 4:22
  • Yes. This should be in ur template .html file
    – Jackson
    Commented Jun 22, 2017 at 4:38
  • can you help me find the template path
    – Ajay Patel
    Commented Jun 22, 2017 at 5:28
  • i have added in submitted_form.html but not working
    – Ajay Patel
    Commented Jun 22, 2017 at 6:14
  • Please create new question & post your code with that @AjayPatel
    – Jackson
    Commented Jun 22, 2017 at 6:18

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.