Covivo/mobicoop

View on GitHub
api/templates/communicationAlt/en/email/notification/carpool_ask_refused.html.twig

Summary

Maintainability
Test Coverage
{# CAREFUL : Some client might need to replicate this template #}
{% extends 'communicationAlt/fr/email/notification/base.html.twig' %}
{% block body %}
{% set ad = context.ad %}
{% set recipient = context.user %}
{% set sender = context.sender %}
{% set result = context.result %}
{% set outwardOrigin = context.outwardOrigin %}
{% set outwardDestination = context.outwardDestination %}
{% set returnOrigin = context.returnOrigin %}
{% set returnDestination = context.returnDestination %}

<table style="width:480px; font-family:{{api_env('EMAILS_FONT')}}, sans-serif;" cellpadding="0" cellspacing="0" summary="" border="0">
    <tr style="margin-bottom:21px; margin-top:19px;">
        <td align="center">
            <table cellpadding="6" cellspacing="6" summary="" border="0">
                <tr>
                    <td align="center">
                        <p style="color:{{api_env('EMAILS_COLOR_PRIMARY')}}; font-size:19px;" text-align="center" ><b>Your carpool request is declined</b></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    {# intro #}
    <tr>
        <td align="center">
            <table style="width:100%;" cellpadding="4" cellspacing="4" summary="" border="0" >
                <tr>
                    <td style="width:22px">
                        <p> </p>
                    </td>
                    <td align="left">
                        <p style="font-size:11px; margin-bottom:16px;">Hello {{recipient.givenName|capitalize}} {{recipient.shortFamilyName|capitalize}},</p>
                        <p style="font-size:11px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{sender.givenName|capitalize}} {{sender.shortFamilyName|capitalize}}</b> has declined the carpool request for the following trip:</p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>

{# info trajet #}
{% if ad.results[0].frequency == 1 %}
{# ponctuel #}
    <tr>
        <td>
            <table cellpadding="4" cellspacing="4" summary="" border="0">
                <tr>
                <td style="width:22px">
                        <p> </p>
                    </td>
                    <td align="left">
                         <p style="font-size:11px;">Date of your carpool: <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{ ad.results[0].date|date("d/m/Y") }}</b></p>
                    </td>
                </tr>
                <tr>
                <td style="width:22px">
                        <p> </p>
                    </td>
                    <td align="left">
                         <p style="font-size:11px;">Price: <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{ad.results[0].roundedPrice}}€</b></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>
            <table cellpadding="4" cellspacing="6" summary="" border="0">
                <tr>
                    <td style="width:20px">
                        <p> </p>
                    </td>
                    <td>
                        <img
                            src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/origin.png"
                            style="border:0; height:19px; width:19px; background-color:transparent; vertical-align:top;"
                        />
                    </td>
                    <td>
                        <p style="font-size:11px;">{{outwardOrigin.time|date('H:i')}}</p>
                    </td>
                    <td>
                        <p style="font-size:11px; color:{{api_env('EMAILS_COLOR_SECONDARY')}}"><b>{{ outwardOrigin.address.displayLabel[0] }}</b></p>
                    </td>
                </tr>
                <tr>
                    <td style="width:20px">
                        <p> </p>
                    </td>
                    <td>
                        <img
                            src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/destination.png"
                            style="border:0; height:19px; width:19px; background-color:transparent; vertical-align:top;"
                        />
                    </td>
                    <td>
                        <p style="font-size:11px;">{{outwardDestination.time|date('H:i')}}</p>
                    </td>
                    <td>
                        <p style="font-size:11px;"><b style="color:{{api_env('EMAILS_COLOR_PRIMARY')}};"> {{ outwardDestination.address.displayLabel[0] }}</b></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
{% else %}
{# régulier #}
    <tr>
        <td>
            <table cellpadding="4" cellspacing="4" summary="" border="0">
                <tr>
                <td style="width:22px">
                        <p> </p>
                    </td>
                    <td align="left">
                         <p style="font-size:11px;">Your regular trips:  <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{ ad.results[0].startDate|date("d/m/Y") }}</b> to <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{ ad.results[0].toDate|date("d/m/Y") }}</b></p>
                    </td>
                </tr>
                <tr>
                <td style="width:22px">
                        <p> </p>
                    </td>
                    <td align="left">
                         <p style="font-size:11px;">Price: <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{ad.results[0].roundedPrice}}€</b></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>
            <table cellpadding="4" cellspacing="6" summary="" border="0">
                <tr>
                    <td style="width:20px">
                        <p> </p>
                    </td>
                    <td>
                        <img
                            src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/origin.png"
                            style="border:0; height:19px; width:19px; background-color:transparent; vertical-align:top;"
                        />
                    </td>
                    <td>
                        <p style="font-size:11px; color:{{api_env('EMAILS_COLOR_SECONDARY')}}"><b>{{ outwardOrigin.address.displayLabel[0] }}</b></p>
                    </td>
                </tr>
                <tr>
                    <td style="width:20px">
                        <p> </p>
                    </td>
                    <td>
                        <img
                            src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/destination.png"
                            style="border:0; height:19px; width:19px; background-color:transparent; vertical-align:top;"
                        />
                    </td>
                    <td>
                        <p style="font-size:11px;"><b style="color:{{api_env('EMAILS_COLOR_PRIMARY')}};"> {{ outwardDestination.address.displayLabel[0] }}</b></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
        {% for schedule in ad.schedule %}
        <tr>
            <td>
                <table cellpadding="2" cellspacing="2" summary="" border="0">
                    <tr>
                        <td style="width:30px">
                            <p> </p>
                        </td>
                        <td>
                        {% if schedule.monCheck %}
                            <img
                                src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/monGreen.png"
                                style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                            />
                        {% else %}
                            <img
                                src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/monGrey.png"
                                style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                            />
                        {% endif %}
                        </td>
                        <td>
                            {% if schedule.tueCheck %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/tueGreen.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% else %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/tueGrey.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% endif %}
                        </td>
                        <td>
                            {% if schedule.wedCheck %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/wedGreen.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% else %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/wedGrey.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% endif %}
                        </td>
                        <td>
                            {% if schedule.thuCheck %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/thuGreen.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% else %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/thuGrey.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% endif %}
                        </td>
                        <td>
                            {% if schedule.friCheck %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/friGreen.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% else %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/friGrey.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% endif %}
                        </td>
                        <td>
                            {% if schedule.satCheck %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/satGreen.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% else %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/satGrey.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% endif %}
                        </td>
                        <td>
                            {% if schedule.sunCheck %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/sunGreen.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% else %}
                                <img
                                    src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/days/sunGrey.png"
                                    style="border:0; height:25px; width:25px; background-color:transparent; vertical-align:top;"
                                />
                            {% endif %}
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table cellpadding="2" cellspacing="2" summary="" border="0">
                    <tr>
                        <td style="width:26px">
                            <p> </p>
                        </td>
                        <td>
                            <table cellpadding="4" cellspacing="4" summary="" border="0">
                                <tr>
                                    <td>
                                        <p style="color:{{api_env('EMAILS_COLOR_PRIMARY')}}; font-size:11px;"><b>Outward</b></p>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        {% if schedule.outwardPickUpTime == null %}
                                            <p style="font-size:11px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Not concerned</b></p>
                                        {% else %}
                                            <p style="font-size:11px;">Pick-up in <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{schedule.outwardPickUpTime|date('H:i')}}</b></p>
                                        {% endif %}
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        {% if schedule.outwardPickUpTime == null %}
                                            <p style="font-size:11px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Not concerned</b></p>
                                        {% else %}
                                            <p style="font-size:11px;">Drop-off in <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{schedule.outwardDropOffTime|date('H:i')}}</b></p>
                                        {% endif %}
                                    </td>
                                </tr>
                            </table>
                        <td>
                        <td>
                            <table cellpadding="4" cellspacing="4" summary="" border="0">
                                <tr>
                                    <td>
                                        <p style="color:{{api_env('EMAILS_COLOR_PRIMARY')}}; font-size:11px;"><b>Return</b></p>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        {% if schedule.returnPickUpTime == null %}
                                            <p style="font-size:11px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Not concerned</b></p>
                                        {% else %}
                                            <p style="font-size:11px;">Pick-up in <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{schedule.returnPickUpTime|date('H:i')}}</b></p>
                                        {% endif %}
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        {% if schedule.returnPickUpTime == null %}
                                            <p style="font-size:11px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Not concerned</b></p>
                                        {% else %}
                                            <p style="font-size:11px;">Drop-off in <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{schedule.returnDropOffTime|date('H:i')}}</b></p>
                                        {% endif %}
                                    </td>
                                </tr>
                            </table>
                        <td>
                    </tr>
                </table>
                {% if loop.last != true %}
                    <hr style="border: 0.5px solid #F0BFFF;">
                {% endif %}
            </td>
        </tr>
    {% endfor %}
{% endif %}
    <tr>
        <td>
            <table cellpadding="4" cellspacing="4" summary="" border="0">
                <tr>
                    <td style="width:20px">
                        <p> </p>
                    </td>
                    <td align="left">
                        <p style="font-size:11px;">Don't panic, you can  <a href="{{api_env('EMAILS_PLATFORM_URL')}}" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}"> search for a new carpool</a> or <a href="{{api_env('EMAILS_PLATFORM_URL')}}/covoiturage/publierannonce" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}">post an ad</a> to be alerted if there are new carpools near you.</p>
                        </a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
{% endblock %}