{% extends 'mail/_layout.html.twig' %}

{% block mail_subject %}{{ 'promo.mail.subject'|trans({'%code%': promo.title }, 'messages', locale|default('fr')) }}{% endblock %}
{% block mail_eyebrow %}{{ 'promo.mail.eyebrow'|trans({}, 'messages', locale|default('fr')) }}{% endblock %}
{% block mail_heading %}{{ 'promo.mail.heading'|trans({}, 'messages', locale|default('fr')) }}{% endblock %}

{% block mail_body %}
    <p style="margin:0 0 18px;">{{ 'promo.mail.intro'|trans({'%company%': company }, 'messages', locale|default('fr')) }}</p>

    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; margin:0 0 24px; border:1px solid #eadfce; background:#fcf7f0;">
        <tr>
            <td class="email-block" style="padding:18px 22px;">
                <div style="margin:0 0 6px; font-size:11px; letter-spacing:0.18em; text-transform:uppercase; color:#8a6a2f;">{{ 'promo.mail.code_label'|trans({}, 'messages', locale|default('fr')) }}</div>
                <div style="font-family:Georgia, 'Times New Roman', serif; font-size:28px; line-height:1.2; color:#3f2f24;">{{ promo.title }}</div>
            </td>
        </tr>
    </table>

    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; margin:0 0 24px; border-top:1px solid #eadfce; border-bottom:1px solid #eadfce;">
        <tr>
            <td class="email-line-label" style="width:180px; padding:16px 0; vertical-align:top; font-size:11px; letter-spacing:0.18em; text-transform:uppercase; color:#8a6a2f;">{{ 'promo.mail.benefit_label'|trans({}, 'messages', locale|default('fr')) }}</td>
            <td class="email-line-value" style="padding:16px 0; color:#3f2f24;">{{ benefit_label }}</td>
        </tr>
        <tr>
            <td class="email-line-label" style="width:180px; padding:16px 0; vertical-align:top; font-size:11px; letter-spacing:0.18em; text-transform:uppercase; color:#8a6a2f;">{{ 'promo.mail.validity_label'|trans({}, 'messages', locale|default('fr')) }}</td>
            <td class="email-line-value" style="padding:16px 0; color:#3f2f24;">{{ validity_label }}</td>
        </tr>
    </table>

    {% if condition_lines is not empty %}
        <div style="margin:0 0 10px; font-size:11px; letter-spacing:0.18em; text-transform:uppercase; color:#8a6a2f;">{{ 'promo.mail.conditions_label'|trans({}, 'messages', locale|default('fr')) }}</div>
        <div class="email-block" style="margin:0 0 24px; padding:18px 22px; border:1px solid #eadfce; background:#fffaf5;">
            <ul style="margin:0; padding-left:18px; color:#6e5848;">
                {% for condition in condition_lines %}
                    <li style="margin:0 0 6px;">{{ condition }}</li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}

    {% if promo.assignedUser and promo.auto %}
        <p style="margin:0 0 18px;">{{ 'promo.mail.auto_notice'|trans({}, 'messages', locale|default('fr')) }}</p>
    {% else %}
        <p style="margin:0 0 18px;">{{ 'promo.mail.manual_notice'|trans({}, 'messages', locale|default('fr')) }}</p>
    {% endif %}

    <p style="margin:0;">{{ 'promo.mail.footer'|trans({'%company%': company }, 'messages', locale|default('fr')) }}</p>
{% endblock %}
