Justmac
Justmac

Reputation: 550

Email template Magento doesn't work

When someone sends me an email by the contact form in magento, the emails arrive with no layout, it shows only the whole layout code.

What should be like this:

Er is een bericht verstuurd via het contactformulier,

Bericht:

Beste meneer/mevrouw Het bericht van de persoon die contact op heeft genomen


Comes in like this:

<!--@vars
{"var data.name":"Sender Name",
"var data.email":"Sender Email",
"var data.telephone":"Sender Telephone",
"var data.comment":"Comment"}
@-->

<div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
<table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
<tr>
<td align="center" valign="top">
<!-- [ header starts here] -->
<table cellspacing="0" cellpadding="0" border="0" width="650">
<tr>
<td valign="top">
<a href="http://www.mijndomeinnaam.nl/"><img src="http://www.mijndomeinnaam.nl/skin/frontend/default/grayscale/images/logo_email.gif" alt="omschrijving logo" style="margin-bottom:10px;" border="0"/></a></td>
</tr>
</table>

<!-- [ middle starts here] -->
<table cellspacing="0" cellpadding="0" border="0" width="650">
<tr>
<td valign="top">
<p><strong>Er is een bericht verstuurd via het contactformulier</strong>,</p>
<ul>
<li>Naam: Jan</li>
<li>E-mail: [email protected]</li>
<li>Telefoon: nvt</li>
</ul>

<p><strong>Bericht:</strong></p>
<p>Beste meneer/mevrouw

Het bericht van de persoon die contact op heeft genomen

</p>
</td>
</tr>
</table>

</td>
</tr>
</table>
</div>

How to fix this?

Upvotes: 0

Views: 2661

Answers (2)

Magento
Magento

Reputation: 239

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

change

       <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> 

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> 

that is: html instead of text

Upvotes: 2

Italo Andr&#233;
Italo Andr&#233;

Reputation: 472

On your magento database, go to the 'core_email_template' table. In the 'template_type' column, change the value for '2'. (apply this to all the fields that have this column as '1' or to all the fields you want to set as HTML, not just text)

Doing this, you are saying that this e-mail template is HTML type instead text. I hope it works.

Upvotes: 1

Related Questions