Add a link to the "bda-rappel" mail edition page

This commit is contained in:
Martin Pépin 2017-06-02 19:33:23 +01:00
parent 4fce1e8afc
commit 5c11893059
2 changed files with 23 additions and 3 deletions

View file

@ -23,6 +23,15 @@
</form> </form>
{% endif %} {% endif %}
</div> </div>
<hr \>
<p>
<em>Note :</em> le template de ce mail peut être modifié à
<a href="{% url 'admin:custommail_custommail_change' custommail_id %}">cette adresse</a>
</p>
<hr \>
<h3>Forme des mails</h3> <h3>Forme des mails</h3>
@ -35,4 +44,5 @@
{% for part in exemple_mail_2places %} {% for part in exemple_mail_2places %}
<pre>{{ part }}</pre> <pre>{{ part }}</pre>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}

View file

@ -9,6 +9,7 @@ from datetime import timedelta
from custommail.shortcuts import ( from custommail.shortcuts import (
send_mass_custom_mail, send_custom_mail, render_custom_mail 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.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib import messages from django.contrib import messages
@ -662,9 +663,18 @@ def send_rappel(request, spectacle_id):
'nb_attr': 2 'nb_attr': 2
}) })
# Contexte # Contexte
ctxt = {'show': show, custommail_id = (
'exemple_mail_1place': exemple_mail_1place, CustomMail.objects
'exemple_mail_2places': exemple_mail_2places} .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é # Envoi confirmé
if request.method == 'POST': if request.method == 'POST':
members = show.send_rappel() members = show.send_rappel()