From 8ad0f91c85b28a6e3ec82d26ff1d3ae1e61a523f Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Thu, 8 Oct 2020 10:21:11 +0200 Subject: [PATCH] first logic in mail template tested --- input/templates/input/ifg_volunteer_mail.txt | 8 +++++++- input/views.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/input/templates/input/ifg_volunteer_mail.txt b/input/templates/input/ifg_volunteer_mail.txt index 0ec22aa..0b5dad9 100644 --- a/input/templates/input/ifg_volunteer_mail.txt +++ b/input/templates/input/ifg_volunteer_mail.txt @@ -1 +1,7 @@ -hello {{realname}} +hello {{data.realname}} +

+{% if data.choice == 'IFG' %} + IFG detected +{% else %} + no IFG detected +{% endif %} diff --git a/input/views.py b/input/views.py index a4df71a..93d4e40 100644 --- a/input/views.py +++ b/input/views.py @@ -91,7 +91,7 @@ class ExternView(CookieWizardView): # we need to send the following mails here: # - mail with entered data to the Volunteer mail_template = get_template('input/ifg_volunteer_mail.txt') - context = { 'realname': data['realname'] } + context = { 'data': data } send_mail( 'form filled', mail_template.render(context),