I am trying to define my own template for e-mail that is sent when user request for password, but it does not work when adding HTML part.
This is the template:
{% trans_default_domain 'FOSUserBundle' %}
{% block subject %}
{% autoescape false %}
{{ 'resetting.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_text %}
{% autoescape false %}
{{ 'resetting.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_html %}
{% autoescape false %}
<div dir="ltr" style="display: block; width: 100%; background: #ffffff">
<table style='width: 100%; border: none'>
<tr style='height: 20px; background-color: #5A82FF'>
<td></td>
</tr>
<tr>
<td style="padding: 30px 0; font-family: Verdana">
{{ 'resetting.email.message_html'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
</td>
</tr>
<tr style='height: 20px; background-color: #4ED53E'>
<td></td>
</tr>
</table>
</div>
{% endautoescape %}
{% endblock %}
When the password request is sent, the mail is received in text format with both parts embedded in it, this way:
Estimado jstuardo@desytec.com!
Para restablecer tu contraseña - por favor visita http://xxx.xxx.xxx.xxx
Atte,
El equipo de XXX
<div dir="ltr" style="display: block; width: 100%; background: #ffffff">
<table style='width: 100%; border: none'>
<tr style='height: 20px; background-color: #5A82FF'>
<td></td>
</tr>
<tr>
<td style="padding: 30px 0; font-family: Verdana">
Estimado jstuardo@desytec.com!
<br /><br />
Para restablecer tu contraseña - por favor visita http://xxx.xxx.xxx.xxx
<br /><br />
Atte,<br />
El equipo de XXX
</td>
</tr>
<tr style='height: 20px; background-color: #4ED53E'>
<td></td>
</tr>
</table>
</div>
What may be wrong?
Thanks Jaime