Ignore more contact f

This commit is contained in:
app@dynamicweb-production 2023-11-17 03:43:49 +01:00
parent 3c3c614b6b
commit 325d1ffcb9

View file

@ -63,23 +63,23 @@ class ContactUsView(FormView):
) )
def form_valid(self, form): def form_valid(self, form):
form.save() #form.save()
from_emails = { #from_emails = {
'glasfaser': 'glasfaser@ungleich.ch' # 'glasfaser': 'glasfaser@ungleich.ch'
} #}
from_page = self.request.POST.get('from_page') #from_page = self.request.POST.get('from_page')
email_data = { #email_data = {
'subject': "{dcl_text} Message from {sender}".format( # 'subject': "{dcl_text} Message from {sender}".format(
dcl_text=settings.DCL_TEXT, # dcl_text=settings.DCL_TEXT,
sender=form.cleaned_data.get('email') # sender=form.cleaned_data.get('email')
), # ),
'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, # 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,
'to': [from_emails.get(from_page, 'support@ungleich.ch')], # 'to': [from_emails.get(from_page, 'support@ungleich.ch')],
'body': "\n".join( # 'body': "\n".join(
["%s=%s" % (k, v) for (k, v) in form.cleaned_data.items()]), # ["%s=%s" % (k, v) for (k, v) in form.cleaned_data.items()]),
'reply_to': [form.cleaned_data.get('email')], # 'reply_to': [form.cleaned_data.get('email')],
} #}
send_plain_email_task.delay(email_data) #send_plain_email_task.delay(email_data)
if self.request.is_ajax(): if self.request.is_ajax():
return self.render_to_response( return self.render_to_response(
self.get_context_data(success=True, contact_form=form)) self.get_context_data(success=True, contact_form=form))