notification_flux.html.twig 2.71 KB
Newer Older
Julien Jorry committed
1 2 3 4 5 6 7 8 9 10
{% extends '@kohinos/email/email_layout.html.twig' %}

{% set title %}{% spaceless %}
	{{ subject }}
{% endspaceless %}
{% endset %}

{% block content %}
	<h2 style="font-size: 18px; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: bold; line-height: 1.2em; margin: 40px 0 10px;">{{ user.name|title }}</h2><br/>
	<h3>
11 12 13
		{% if flux.reference == constant('App\\Entity\\AchatMonnaieAdherent::REFERENCE_ACHAT_MONNAIE_ADHERENT_EN_CB_RECURRENT') %}
			{{ flux.reference }}
		{% elseif flux.type == 'reconversion' %}
Julien Jorry committed
14
			{{ 'Demande de reconversion' }}
Yvon committed
15 16
		{% elseif flux.type == 'prelevement_cotisation_adherent_depassement_plafond' %}
			{{ "Réduction de l'allocation après dépassement du plafond" }}
17 18 19 20
		{% elseif flux.type == 'prelevement_cotisation_adherent_correction_solde' %}
			{{ "Correction de solde (réduction de l'allocation) suite à une erreur de cotisation" }}
		{% elseif flux.type == 'reversement_cotisation_adherent_correction_solde' %}
			{{ "Correction de solde (allocation complémentaire de la caisse) suite à une erreur de cotisation" }}
Julien Jorry committed
21 22 23 24
		{% else %}
			{{ flux.parenttype|capitalize }} : {{ flux.type|replace({'_' : ' => '}) }}
		{% endif %}
	</h3>
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
	{% if flux.reference == constant('App\\Entity\\AchatMonnaieAdherent::REFERENCE_ACHAT_MONNAIE_ADHERENT_EN_CB_RECURRENT') %}
		<p>Vous avez été prélevé de {{ flux.montant|number_format(2) }} euros</p>
		{% set existingRecurringPayment = checkExistingRecurringPayment(user.email) %}
		{% if existingRecurringPayment|length == 1 %}
			{% set currentRecurringPayment = existingRecurringPayment[0] %}
			{# Counting time since initial payment is the trick I use here to easily compute a realistic prelevement number #}
			{# This estimate will be wrong in some cases where what happened on Payzen is different from
			what was expected when payment has been created #}
			<p>Echéance n°{{ currentRecurringPayment.monthNumberSinceInitialPaymentDate }}.</p>
			<p>{{ currentRecurringPayment.reason }}</p>
			<p>Pour demander une interruption anticipée, merci de contacter la caisse à l'adresse {{ KOH_MLC_CONTACT_EMAIL }} au minimum dix jours avant la prochaine échéance.</p>
		{% elseif existingRecurringPayment|length > 1 %}
			<p>Vous avez plusieurs paiements récurrents en cours. Merci de contacter la caisse à l'adresse {{ KOH_MLC_CONTACT_EMAIL }} pour un dépannage.</p>
		{% else %}
			<p>Vous n'avez plus aucun paiement récurrent en cours.</p>
		{% endif %}
	{% else %}
		<p>De {{ flux.expediteur }} à {{ flux.destinataire }}</p>
		<p>Montant de {{ flux.montant|number_format(2) }} (Moyen : {{ flux.moyen }})</p>
		<p>Référence : {{ flux.reference }}</p>
	{% endif %}
Julien Jorry committed
46 47
	{# <p>Opérateur : {{ flux.operateur.name }}</p> #}
{% endblock %}