Set Reply-To headers to the event's contact address

This commit is contained in:
Raphael Michel
2017-01-24 18:34:53 +01:00
parent aba7652aee
commit 48461122f8

View File

@@ -63,6 +63,8 @@ def mail(email: str, subject: str, template: str,
if email == INVALID_ADDRESS:
return
headers = headers or {}
with language(locale):
if isinstance(context, dict) and order:
try:
@@ -103,6 +105,9 @@ def mail(email: str, subject: str, template: str,
htmlctx['event'] = event
htmlctx['color'] = event.settings.primary_color
if event.settings.mail_from == settings.DEFAULT_FROM_EMAIL and event.settings.contact_mail:
headers['Reply-To'] = event.settings.contact_mail
prefix = event.settings.get('mail_prefix')
if prefix:
subject = "[%s] %s" % (prefix, subject)