Covivo/mobicoop

View on GitHub
api/templates/communicationAlt/en/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:20px;" text-align="center" ><b>Your carpool is confirmed !</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>
                        {% if ad.results[0].frequency == 1 %}
                            <p style="font-size:11px;">Your carpool is confirmed. Here is the summary of your carpool:</p>
                        {% else %}
                            <p style="font-size:11px;">Your carpool is confirmed. Here is the summary of your carpools:</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:11px;">Your driver:
                                    {% else %}
                                        <p style="font-size:11px;">Your passenger:
                                    {% endif %}
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <p style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}; font-size:11px;"> {{sender.givenName|capitalize}} {{sender.shortFamilyName|capitalize}}</p>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <p style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}; font-size:11px;"> {{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: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 %}


{# How to prepare your carpool  #}
    <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:11px;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}; font-size:15px;" >How to prepare your carpool ?</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:11px; text-align: justify;"> Be sure to define your pick-up and drop-off point with your carpooler beforehand. You can help yourself <a href="{{api_env('EMAILS_PLATFORM_URL')}}/points-relais" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">relay points map.</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:11px; text-align: justify;"> Payment can be made by hand on the day of the carpool or by credit card from <a href="{{api_env('EMAILS_PLATFORM_URL')}}/utilisateur/profil/modifier/mes-covoiturages-acceptes" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}}">My accepted carpools</a> after the trip. Agree with your carpooler on the paiement method you prefer.  <a href="https://pro.mobicoop.fr/comment-regler-ses-covoiturages-sur-mobicoop/" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">Our tutorial.</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:11px; text-align: justify;"><b style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};"> Beware, ill-intentioned people may ask you for other means of payment, in particular via prepaid cards (Transcash). Refuse these fraudulent practices and report this user to us.</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:11px; text-align: justify;">If your region or department gives carpooling bonuses, it is essential to certify pick-up and drop-off on the day of carpooling in your application via My accepted carpools. This activates geolocation and sends a proof of carpooling to your territory.. <a href="{{api_env('EMAILS_PLATFORM_URL')}}/FAQ" style="color:{{api_env('EMAILS_COLOR_SECONDARY')}};">To understand the bonus system.</a></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="height:20px">
            <p> </p>
        </td>
    </tr>
</table>
{% endblock %}