Covivo/mobicoop

View on GitHub
api/templates/communicationAlt/fr/email/notification/carpool_ask_accepted.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:22px;" text-align="center" ><b>Votre covoiturage est confirmé !</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:13px; margin-bottom:16px;">Bonjour {{recipient.givenName|capitalize}} {{recipient.shortFamilyName|capitalize}},</p>
                        {% if ad.results[0].frequency == 1 %}
                            <p style="font-size:13px;">Votre covoiturage est confirmé. Voici le récapitulatif de votre covoiturage:</p>
                        {% else %}
                            <p style="font-size:13px;">Votre covoiturage est confirmé. Voici le récapitulatif de vos covoiturages:</p>
                        {% endif %}
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    {# info carpooler #}
    <tr>
        <td>
            <table cellpadding="4" cellspacing="4" summary="" border="0">
                <tr>
                    <td style="width:20px">
                        <p> </p>
                    </td>
                    <td style="width:65px">
                        <img  style="border-radius:50px; height:65px; width:65px;" src="{{ api_env('EMAILS_PLATFORM_URL') }}{{sender.avatars[0]}}" alt="Avatar"/>
                    </td>
                    <td align="left">
                        <table cellpadding="0" cellspacing="0" summary="" border="0">
                            <tr>
                            {# gérer si conducteur ou passager #}
                                <td align="left">
                                    {% if context.recipientRole == 2 %}
                                        <p style="font-size:13px;">Votre conducteur / conductrice:
                                    {% else %}
                                        <p style="font-size:13px;">Votre passager / passagère:
                                    {% endif %}
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <p style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}; font-size:13px;"> {{sender.givenName|capitalize}} {{sender.shortFamilyName|capitalize}}</p>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <p style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}; font-size:13px;"> {{sender.telephone}}</p>
                                </td>
                            </tr>
                        </table>
                    </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:13px;">Date de votre covoiturage: <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:13px;">Prix: <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:13px;">{{outwardOrigin.time|date('H:i')}}</p>
                    </td>
                    <td>
                        <p style="font-size:13px; 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:13px;">{{outwardDestination.time|date('H:i')}}</p>
                    </td>
                    <td>
                        <p style="font-size:13px;"><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:13px;">Vos trajets réguliers: du <b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">{{ ad.results[0].startDate|date("d/m/Y") }}</b> au <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:13px;">Prix: <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:13px; 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:13px;"><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:13px;"><b>Aller</b></p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    {% if schedule.outwardPickUpTime == null %}
                                        <p style="font-size:13px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Non concerné</b></p>
                                    {% else %}
                                        <p style="font-size:13px;">Prise en charge à <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:13px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Non concerné</b></p>
                                    {% else %}
                                        <p style="font-size:13px;">Dépose à <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:13px;"><b>Retour</b></p>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    {% if schedule.returnPickUpTime == null %}
                                        <p style="font-size:13px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Non concerné</b></p>
                                    {% else %}
                                        <p style="font-size:13px;">Prise en charge à <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:13px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Non concerné</b></p>
                                    {% else %}
                                        <p style="font-size:13px;">Dépose à <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 %}


{# Comment bien préparer votre covoiturage  #}
    <tr>
        <td style="height:20px">
            <p> </p>
        </td>
    </tr>
    <tr>
        <td>
            <table cellpadding="6" cellspacing="6" summary="" border="0">
                <tr>
                    <td style="width:13px">
                        <p> </p>
                    </td>
                    <td align="left" style="text-align:center;" >
                        <p style="font-size:13px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}; font-size:17px;" >Comment bien préparer votre covoiturage ?</b></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    {# point 1 #}
    <tr>
        <td>
            <table cellpadding="4" cellspacing="4" summary="" border="0">
                <tr>
                    <td align="left" valign="top">
                        <img
                            src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/numbers/1.png"
                            style="border:0; height:24px; width:26px; background-color:transparent; vertical-align:top;"
                        />
                    </td>
                    <td align="center" >
                        <p style="font-size:13px; text-align: justify;"> Veillez à bien définir votre point de prise en charge et de dépose avec votre covoitureur au préalable. Vous pouvez vous aider avec <a href="{{api_env('EMAILS_PLATFORM_URL')}}/points-relais" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">la carte des points relais.</a></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
{# point 2 #}
    <tr>
        <td>
            <table cellpadding="4" cellspacing="4" summary="" border="0">
                <tr>
                    <td align="left" valign="top" >
                        <img
                            src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/numbers/2.png"
                            style="border:0; height:24px; width:26px; background-color:transparent; vertical-align:top;"
                        />
                    </td>
                    <td align="center" >
                        <p style="font-size:13px; text-align: justify;"> Le paiement peut se faire de la main à la main le jour du covoiturage ou par carte bancaire depuis <a href="{{api_env('EMAILS_PLATFORM_URL')}}/utilisateur/profil/modifier/mes-covoiturages-acceptes" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}">Mes covoiturages acceptés</a> après le covoiturage. Mettez vous d’accord avec votre covoitureur sur la solution que vous préférez.  <a href="https://pro.mobicoop.fr/comment-regler-ses-covoiturages-sur-mobicoop/" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Suivre notre tutoriel.</a></p>
                    </td>
                </tr>
                 {#attention  #}
                <tr>
                    <td>
                        <p> </p>
                    </td>
                    <td>
                        <table cellpadding="1" cellspacing="1" summary="" border="0">
                            <tr>
                                <td align="right"  valign="top" >
                                    <img
                                        src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/warning.png"
                                        style="border:0; height:19px; width:22px; background-color:transparent; vertical-align:top;"
                                    />
                                </td>
                                <td align="left" vertical-align:"top" >
                                    <p style="font-size:13px; text-align: justify;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};"> Attention, des personnes mal intentionnées peuvent vous demander d’autres moyens de paiement, notamment via des cartes prépayées (Transcash), refusez ces pratiques frauduleuses et signalez-nous cet utilisateur.</b></p>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
        {# point 3 #}
     <tr>
        <td>
            <table cellpadding="4" cellspacing="4" summary="" border="0">
                <tr>
                    <td align="left"  valign="top">
                        <img
                            src="{{api_env('EMAILS_PLATFORM_URL')}}{{api_env('EMAILS_IMAGES_BASE_URL')}}/bodyAlt/numbers/3.png"
                            style="border:0; height:24px; width:26px; background-color:transparent; vertical-align:top;"
                        />
                    <td align="left" >
                        <p style="font-size:13px; text-align: justify;">Si votre région ou département subventionne le covoiturage, il est alors primordial de certifier la prise en charge et la dépose le jour du covoiturage depuis votre application dans Mes covoiturages acceptés. Ceci active la géolocalisation et envoie une preuve de covoiturage à votre territoire. <a href="{{api_env('EMAILS_PLATFORM_URL')}}/FAQ" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Comprendre le système des subventions.</a></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="height:20px">
            <p> </p>
        </td>
    </tr>
</table>
{% endblock %}