From 5c11893059a664c34ef34b51c9233d7504b5c9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 2 Jun 2017 19:33:23 +0100 Subject: [PATCH] Add a link to the "bda-rappel" mail edition page --- bda/templates/bda/mails-rappel.html | 10 ++++++++++ bda/views.py | 16 +++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/bda/templates/bda/mails-rappel.html b/bda/templates/bda/mails-rappel.html index 21fcc407..342b24a6 100644 --- a/bda/templates/bda/mails-rappel.html +++ b/bda/templates/bda/mails-rappel.html @@ -23,6 +23,15 @@ {% endif %} + +
+ +

+ Note : le template de ce mail peut être modifié à + cette adresse +

+ +

Forme des mails

@@ -35,4 +44,5 @@ {% for part in exemple_mail_2places %}
{{ part }}
{% endfor %} + {% endblock %} diff --git a/bda/views.py b/bda/views.py index 75716ba5..2149594a 100644 --- a/bda/views.py +++ b/bda/views.py @@ -9,6 +9,7 @@ from datetime import timedelta from custommail.shortcuts import ( send_mass_custom_mail, send_custom_mail, render_custom_mail ) +from custommail.models import CustomMail from django.shortcuts import render, get_object_or_404 from django.contrib.auth.decorators import login_required from django.contrib import messages @@ -662,9 +663,18 @@ def send_rappel(request, spectacle_id): 'nb_attr': 2 }) # Contexte - ctxt = {'show': show, - 'exemple_mail_1place': exemple_mail_1place, - 'exemple_mail_2places': exemple_mail_2places} + custommail_id = ( + CustomMail.objects + .filter(shortname="bda-rappel") + .values_list("id", flat=True) + [0] + ) + ctxt = { + 'show': show, + 'exemple_mail_1place': exemple_mail_1place, + 'exemple_mail_2places': exemple_mail_2places, + 'custommail_id': custommail_id, + } # Envoi confirmé if request.method == 'POST': members = show.send_rappel()