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

{% block mail_subject %}
    {{ (resubmission
        ? 'marketing.review.submission_mail.resubmitted_subject'
        : 'marketing.review.submission_mail.subject')|trans({'%product%': product_label}, 'messages', locale|default('fr')) }}
{% endblock %}
{% block mail_eyebrow %}{{ company }}{% endblock %}
{% block mail_heading %}
    {{ (resubmission
        ? 'marketing.review.submission_mail.resubmitted_heading'
        : 'marketing.review.submission_mail.heading')|trans({}, 'messages', locale|default('fr')) }}
{% endblock %}

{% block mail_body %}
    <p style="margin:0 0 26px;">
        {{ 'marketing.review.submission_mail.intro'|trans({
            '%author%': review.authorDisplayName,
            '%product%': product_label,
        }, 'messages', locale|default('fr')) }}
    </p>

    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" bgcolor="#fcf7f0" style="width:100%; margin:0 0 26px; border:1px solid #eadfce; background:#fcf7f0;">
        <tr>
            <td colspan="2" style="padding:20px 22px 12px; font-family:Georgia, 'Times New Roman', serif; font-size:22px; line-height:1.35; color:#3f2f24;">
                {{ 'marketing.review.submission_mail.details_heading'|trans({}, 'messages', locale|default('fr')) }}
            </td>
        </tr>
        <tr>
            <td class="detail-label" width="34%" style="padding:9px 10px 9px 22px; font-size:13px; color:#8c7564;">
                {{ 'marketing.review.field.author'|trans({}, 'messages', locale|default('fr')) }}
            </td>
            <td class="detail-value" style="padding:9px 22px 9px 10px; color:#3f2f24;">{{ review.authorDisplayName }}</td>
        </tr>
        <tr>
            <td class="detail-label" width="34%" style="padding:9px 10px 9px 22px; font-size:13px; color:#8c7564;">
                {{ 'marketing.review.field.product'|trans({}, 'messages', locale|default('fr')) }}
            </td>
            <td class="detail-value" style="padding:9px 22px 9px 10px; color:#3f2f24;">{{ product_label }}</td>
        </tr>
        <tr>
            <td class="detail-label" width="34%" style="padding:9px 10px 9px 22px; font-size:13px; color:#8c7564;">
                {{ 'marketing.review.field.rating'|trans({}, 'messages', locale|default('fr')) }}
            </td>
            <td class="detail-value" style="padding:9px 22px 9px 10px; color:#3f2f24; font-size:18px; font-weight:700;">
                {{ 'marketing.review.admin.filters.rating_value'|trans({'%rating%': review.rating}, 'messages', locale|default('fr')) }}
            </td>
        </tr>
        <tr>
            <td class="detail-label" width="34%" style="padding:9px 10px 20px 22px; font-size:13px; color:#8c7564;">
                {{ 'marketing.review.field.date'|trans({}, 'messages', locale|default('fr')) }}
            </td>
            <td class="detail-value" style="padding:9px 22px 20px 10px; color:#3f2f24;">{{ review.submittedAt|date('d/m/Y H:i') }}</td>
        </tr>
    </table>

    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; margin:0 0 24px; border:1px solid #eadfce;">
        {% if review.title %}
            <tr>
                <td style="padding:20px 22px 0; font-weight:700; color:#3f2f24;">{{ review.title }}</td>
            </tr>
        {% endif %}
        <tr>
            <td style="padding:{{ review.title ? '12px' : '20px' }} 22px 20px; color:#6e5848;">
                <div style="margin:0 0 8px; font-size:11px; letter-spacing:0.14em; text-transform:uppercase; color:#8a6a2f;">
                    {{ 'marketing.review.field.comment'|trans({}, 'messages', locale|default('fr')) }}
                </div>
                <div style="color:#3f2f24;">{{ review.comment|e|nl2br }}</div>
            </td>
        </tr>
    </table>

    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" bgcolor="#fffaf5" style="width:100%; margin:0 0 26px; border-left:3px solid #8a6a2f; background:#fffaf5;">
        <tr>
            <td style="padding:18px 20px; font-size:14px; line-height:1.65; color:#6e5848;">
                {{ 'marketing.review.submission_mail.neutrality_notice'|trans({}, 'messages', locale|default('fr')) }}
            </td>
        </tr>
    </table>

    {% if publish_url or reject_url %}
        <p style="margin:0 0 18px; font-size:14px;">
            {{ 'marketing.review.submission_mail.action_help'|trans({}, 'messages', locale|default('fr')) }}
        </p>
        <table role="presentation" cellspacing="0" cellpadding="0" class="email-actions" style="margin:0;">
            <tr>
                {% if publish_url %}
                    <td style="padding:0 10px 0 0;">
                        <a href="{{ publish_url }}" style="display:inline-block; padding:14px 20px; background:#3f2f24; color:#ffffff; font-weight:700; text-decoration:none;">
                            {{ 'marketing.review.submission_mail.publish_button'|trans({}, 'messages', locale|default('fr')) }}
                        </a>
                    </td>
                {% endif %}
                {% if reject_url %}
                    <td style="padding:0;">
                        <a href="{{ reject_url }}" style="display:inline-block; padding:13px 20px; border:1px solid #8a6a2f; color:#6f5525; font-weight:700; text-decoration:none;">
                            {{ 'marketing.review.submission_mail.reject_button'|trans({}, 'messages', locale|default('fr')) }}
                        </a>
                    </td>
                {% endif %}
            </tr>
        </table>
    {% else %}
        <table role="presentation" cellspacing="0" cellpadding="0" style="margin:0;">
            <tr>
                <td class="email-button" bgcolor="#3f2f24" style="background:#3f2f24;">
                    <a href="{{ moderation_url }}" style="display:inline-block; padding:14px 20px; color:#ffffff; font-weight:700; text-decoration:none;">
                        {{ 'marketing.review.submission_mail.view_button'|trans({}, 'messages', locale|default('fr')) }}
                    </a>
                </td>
            </tr>
        </table>
    {% endif %}
{% endblock %}
