From f7a374877a2333dfb63ee195185fa856211986aa Mon Sep 17 00:00:00 2001 From: j Date: Tue, 26 Oct 2021 16:51:56 +0100 Subject: [PATCH] thanks --- app/contact/views.py | 1 + app/templates/contact.html | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/contact/views.py b/app/contact/views.py index 5053929..c9d8ee8 100644 --- a/app/contact/views.py +++ b/app/contact/views.py @@ -15,6 +15,7 @@ def index(request): to = settings.CONTACT_TO_EMAIL msg = EmailMessage(subject, message, from_, to, reply_to=[form.cleaned_data['email']]) msg.send(fail_silently=True) + context['submitted'] = True else: context['form'] = form return render(request, 'contact.html', context) diff --git a/app/templates/contact.html b/app/templates/contact.html index a0e4be0..3a74058 100644 --- a/app/templates/contact.html +++ b/app/templates/contact.html @@ -3,6 +3,9 @@ {% block body_class%}animated animated-text{% endblock %} {% block main %}
+ {% if submitted %} + Thanks for your message + {% else %}

Contact 聯絡

{% endblock %}