rodrigobertin
9/4/2018 - 2:57 PM

Template mail in twig

Template mail in twig

{% set color = globales.color %}
<html lang="es" style="overflow-x: hidden;margin:0">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Consulta Web</title>
</head>
<body style="overflow-x:hidden; margin:0">

<table style="width: 95%;background-color: white;margin: 10px auto;display: table;border:1px solid #c1c1c1">
  {# Logo #}
  <thead>
    <tr style="background-color:{{ color }};padding: 20px 0;text-align: center;width: 100%">
      <th style="padding: 25px 0;width: 100%;display: block">
        <img style="width: 150px;height: auto" src="{{ globales.logo }}" alt="Logo">
      </th>
    </tr>
  </thead>

  {# Body table #}
  <tbody>
  <tr style="width: 100%">
    <td style="padding: 8px">
      {# Cuerpo extra del mail #}
      {% if body is defined %}
        {{ body | raw }}
      {% endif %}

      {# Datos en array #}
      {% if datos is defined %}
        <ul style="list-style: none;padding-left: 5px">
          {% for key,value in datos %}
            <li><b>{{ key | upper }}: </b>{{ value }}</li>
          {% endfor %}
        </ul>
      {% endif %}

      {#
      <ul style="display: block;padding:10px 0;color:#FFF;text-align: center;margin: 0 auto;width:100%;background-color:{{ color }}">
        <li style="display: inline-block;color:#FFF">{{ global.mail }}</li>
        <li style="display: inline-block;color:#FFF"> | </li>
        <li style="display: inline-block;color:#FFF">{{ global.tel }}</li>
        <li style="display: inline-block;color:#FFF"> | </li>
        <li style="display: inline-block;color:#FFF">{{ global.dir }}</li>
      </ul>
      #}
    </td>
  </tr>
  </tbody>
</table>

</body>
</html>