diff options
author | Alban Gruin | 2017-01-25 14:34:55 +0100 |
---|---|---|
committer | Alban Gruin | 2017-01-25 14:34:55 +0100 |
commit | 1aa8092ae3fab47e78a02dabb6564aff4a981e04 (patch) | |
tree | b26d2e2d14ac5a16f63986793f45017be741a4ca | |
parent | a4a3aa91a9eacf0f67442d79d8aaee01b7a1256b (diff) |
Déplacement et renommage des templates des mails
-rw-r--r-- | management/commands/sendmails.py | 4 | ||||
-rw-r--r-- | templates/mail/mail_confirm.txt (renamed from templates/mail_confirm.txt) | 2 | ||||
-rw-r--r-- | templates/mail/mail_footer.txt (renamed from templates/mail_footer.txt) | 0 | ||||
-rw-r--r-- | templates/mail/mail_timetable.txt (renamed from templates/timetable_email.txt) | 0 | ||||
-rw-r--r-- | views.py | 2 |
5 files changed, 4 insertions, 4 deletions
diff --git a/management/commands/sendmails.py b/management/commands/sendmails.py index 1669bcc..b42d3d5 100644 --- a/management/commands/sendmails.py +++ b/management/commands/sendmails.py @@ -30,11 +30,11 @@ class Command(BaseCommand): courses = Course.objects.get_courses_for_group(subscription.group, begin__gte=start, begin__lt=end) grouped_courses = group_courses(courses) - template = loader.get_template("timetable_email.txt") + template = loader.get_template("mail/mail_timetable.txt") context = Context({"subscription": subscription, "courses": grouped_courses, "week": week}) content[subscription.group.id] = template.render(context) - footer = loader.get_template("mail_footer.txt") + footer = loader.get_template("mail/mail_footer.txt") context = Context({"admins": settings.ADMINS, "token": subscription.token}) mail_content = content[subscription.group.id] + footer.render(context) diff --git a/templates/mail_confirm.txt b/templates/mail/mail_confirm.txt index 3ceb4cf..77849a0 100644 --- a/templates/mail_confirm.txt +++ b/templates/mail/mail_confirm.txt @@ -6,4 +6,4 @@ Si vous pensez que vous avez été inscrit par erreur, suivez ce lien : {% url " Vous ne recevrez aucun mail tant que vous n'avez pas validé votre abonnement. -{% include "mail_footer.txt" %} +{% include "mail/mail_footer.txt" %} diff --git a/templates/mail_footer.txt b/templates/mail/mail_footer.txt index 004abe5..004abe5 100644 --- a/templates/mail_footer.txt +++ b/templates/mail/mail_footer.txt diff --git a/templates/timetable_email.txt b/templates/mail/mail_timetable.txt index dcc07d1..dcc07d1 100644 --- a/templates/timetable_email.txt +++ b/templates/mail/mail_timetable.txt @@ -53,7 +53,7 @@ def subscribe(request, group_slug, year, week): subscription = Subscription(email=request.POST["email"], group=group) subscription.save() - template = loader.get_template("mail_confirm.txt") + template = loader.get_template("mail/mail_confirm.txt") context = Context({"group": group, "admins": settings.ADMINS, "token": subscription.token}) send_mail("Confirmation de l'abonnemenent", template.render(context), settings.DEFAULT_FROM_EMAIL, [request.POST["email"]]) |