forked from CGM_Public/pretix_original
Add bcc option for event emails
This commit is contained in:
@@ -106,9 +106,12 @@ def mail(email: str, subject: str, template: Union[str, LazyI18nString],
|
|||||||
'color': '#8E44B3'
|
'color': '#8E44B3'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bcc = []
|
||||||
if event:
|
if event:
|
||||||
htmlctx['event'] = event
|
htmlctx['event'] = event
|
||||||
htmlctx['color'] = event.settings.primary_color
|
htmlctx['color'] = event.settings.primary_color
|
||||||
|
if event.settings.mail_bcc:
|
||||||
|
bcc.append(event.settings.mail_bcc)
|
||||||
|
|
||||||
if event.settings.mail_from == settings.DEFAULT_FROM_EMAIL and event.settings.contact_mail and not headers.get('Reply-To'):
|
if event.settings.mail_from == settings.DEFAULT_FROM_EMAIL and event.settings.contact_mail and not headers.get('Reply-To'):
|
||||||
headers['Reply-To'] = event.settings.contact_mail
|
headers['Reply-To'] = event.settings.contact_mail
|
||||||
@@ -153,6 +156,7 @@ def mail(email: str, subject: str, template: Union[str, LazyI18nString],
|
|||||||
|
|
||||||
send_task = mail_send_task.si(
|
send_task = mail_send_task.si(
|
||||||
to=[email],
|
to=[email],
|
||||||
|
bcc=bcc,
|
||||||
subject=subject,
|
subject=subject,
|
||||||
body=body_plain,
|
body=body_plain,
|
||||||
html=body_html,
|
html=body_html,
|
||||||
|
|||||||
@@ -225,6 +225,10 @@ DEFAULTS = {
|
|||||||
'default': None,
|
'default': None,
|
||||||
'type': str
|
'type': str
|
||||||
},
|
},
|
||||||
|
'mail_bcc': {
|
||||||
|
'default': None,
|
||||||
|
'type': str
|
||||||
|
},
|
||||||
'mail_from': {
|
'mail_from': {
|
||||||
'default': settings.MAIL_FROM,
|
'default': settings.MAIL_FROM,
|
||||||
'type': str
|
'type': str
|
||||||
|
|||||||
@@ -663,6 +663,11 @@ class MailSettingsForm(SettingsForm):
|
|||||||
label=_("Sender address"),
|
label=_("Sender address"),
|
||||||
help_text=_("Sender address for outgoing emails")
|
help_text=_("Sender address for outgoing emails")
|
||||||
)
|
)
|
||||||
|
mail_bcc = forms.EmailField(
|
||||||
|
label=_("Bcc address"),
|
||||||
|
help_text=_("All emails will be sent to this address as a Bcc copy"),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
mail_text_signature = I18nFormField(
|
mail_text_signature = I18nFormField(
|
||||||
label=_("Signature"),
|
label=_("Signature"),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
{% bootstrap_field form.mail_prefix layout="control" %}
|
{% bootstrap_field form.mail_prefix layout="control" %}
|
||||||
{% bootstrap_field form.mail_from layout="control" %}
|
{% bootstrap_field form.mail_from layout="control" %}
|
||||||
{% bootstrap_field form.mail_text_signature layout="control" %}
|
{% bootstrap_field form.mail_text_signature layout="control" %}
|
||||||
|
{% bootstrap_field form.mail_bcc layout="control" %}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{% trans "E-mail content" %}</legend>
|
<legend>{% trans "E-mail content" %}</legend>
|
||||||
|
|||||||
Reference in New Issue
Block a user