3

This is in Magento 1.9.x.

I just edited the contents of a transaction email, added some HTML code into it, but the email is still rendering as plain text.

How do I make that email into a HTML email?

Here is how it looks in Magento:

enter image description here

The email contains HTML tags, but it's template type is Text.

I cannot find anywhere to either (a) change this template type to HTML OR (b) create a new HTML template.

This is the email content:

<body>
<img alt="Flamefast" src="http://www.flamefast-gas-safety.co.uk/skin/frontend/default/gas-safety/images/logo.png" />
<h1>Web Enquiry Form</h1>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>Name:</td><td>{{var data.name}}</td>
</tr>
<tr>
<td>Email:</td><td>{{var data.email}}</td>
</tr>
<tr>
<td>Telephone:</td><td>{{var data.telephone}}</td>
</tr>
<tr>
<td>Company:</td><td>{{var data.company}}</td>
</tr>
<tr>
<td>Interested in:</td><td>{{var data.interest}}</td>
</tr>
<tr>
<td>Quote Required:</td><td>{{var data.request_quote}}</td>
</tr>
<tr>
<td>Info Required:</td><td>{{var data.request_info}}</td>
</tr>
<tr>
<td>Call-back Required:</td><td>{{var data.request_callback}}</td>
</tr>
<tr>
<td>Message:</td><td>{{var data.comment}}</td>
</tr>
</table>
</body>

And this is what it looks like in my email client. None of the HTML is being rendered. My problem here is I cant find anything in Magento's Admin Panel that could create a HTML email or change this to a HTML email.

Can anyone help?

5

I think you'll find all the necessary info here: How to override config.xml

Don't forget to clear the cache and create a new contact email template in the admin (or delete them to use the default HTML template from /app/locale/xx_YY/template/email), as the changes will be visible only in this case.

1

Very old post but nevertheless I stumbled about this again:

When creating the transactional template it depends on the code which is used whether it will be plain text or html. So in case you used the standard "contacts" text:

Name: {{var data.name}}
Email: {{var data.email}}
Telephone: {{var data.telephone}}
Comment: {{var data.comment}}

it will be plain text.

But using

<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td>
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td class="action-content">
                        <h1>Hi admin,</h1>
                        <p>{{var data.name}} (contact details: {{var data.email}} {{var data.telephone}}) asked a question on your website: </p>
                        <p class="highlighted-text">
                        {{var data.comment}}
                        </p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

will result in an html template.

Hope this helps.

0

Open app/code/core/Mage/Contacts/etc/config.xml

Note: You can create your own module and override the contact module config.xml file OR copy the original file to app/code/local/Mage/Contacts/etc/config.xml first then edit it.

<email>
   <contacts_email_email_template translate="label" module="contacts">
       <label>Contact Form</label>
       <file>contact_form.html</file>
       <type>text</type>
   </contacts_email_email_template>
</email>

Replace to

<email>
   <contacts_email_email_template translate="label" module="contacts">
       <label>Contact Form</label>
       <file>contact_form.html</file>
       <type>html</type>
   </contacts_email_email_template>
</email>
  • Editing the core is a very bad practice as changes will most likely be overriden when upgrading Magento. Update your answer so you suggest to copy the original file to app/code/local/Mage/Contacts/etc/config.xml first then edit it – Raphael at Digital Pianism Sep 26 '16 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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