diff --git a/input/templates/input/ifg_volunteer_mail.txt b/input/templates/input/ifg_volunteer_mail.txt new file mode 100644 index 0000000..0ec22aa --- /dev/null +++ b/input/templates/input/ifg_volunteer_mail.txt @@ -0,0 +1 @@ +hello {{realname}} diff --git a/input/views.py b/input/views.py index d5c9625..a4df71a 100644 --- a/input/views.py +++ b/input/views.py @@ -4,6 +4,8 @@ from django.http import HttpResponse from formtools.wizard.views import CookieWizardView from django.core.mail import send_mail from django.conf import settings +from django.template.loader import get_template +from django.template import Context from .forms import ProjectForm, VolunteerForm, LibraryForm, IFGForm from .models import Project @@ -88,9 +90,11 @@ 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'] } send_mail( 'form filled', - 'you are such a great form filler!', + mail_template.render(context), settings.IF_EMAIL, [form.email], fail_silently=False,