Skip to content
Snippets Groups Projects
Commit cc4764b7 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Merge branch 'zammad-headers' into 'master'

Allow to configure email notification recipient for events

See merge request !11
parents 8e8ed089 999b2737
No related branches found
No related tags found
1 merge request!11Allow to configure email notification recipient for events
Pipeline #58371 canceled
......@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Added
~~~~~
* Allow to configure email notification recipient for events
`1.3.2`_
--------
......
......@@ -108,7 +108,11 @@ class Event(ExtensibleModel):
information = RichTextField(verbose_name=_("Information about the event"))
terms = models.ManyToManyField(Terms, verbose_name=_("Terms"), related_name="event", blank=True)
info_mailings = models.ManyToManyField(
InfoMailing, verbose_name=_("Info mailings"), related_name="events", through="EventInfoMailingThrough", blank=True
InfoMailing,
verbose_name=_("Info mailings"),
related_name="events",
through="EventInfoMailingThrough",
blank=True,
)
def save(self, *args, **kwargs):
......
from django.conf import settings
from django.forms import EmailField
from django.utils.translation import gettext_lazy as _
from dynamic_preferences.preferences import Section
from dynamic_preferences.types import StringPreference
from aleksis.core.registries import site_preferences_registry
paweljong = Section("paweljong", verbose_name=_("Paweljong"))
@site_preferences_registry.register
class EventNotificationRecipient(StringPreference):
"""Mail recipient for event nofications (e.g. registrations)."""
section = paweljong
name = "event_notification_recipient"
default = settings.ADMINS[0][1]
verbose_name = _("Mail recipient for event notifications")
field_class = EmailField
required = True
......@@ -651,12 +651,13 @@ class RegisterEventWizardView(SessionWizardView):
send_templated_mail(
template_name="event_registered",
from_email=get_site_preferences()["mail__address"],
recipient_list=["orga@teckids.org"],
recipient_list=get_site_prefenreces()["paweljong__event_notification_recipient"],
headers={
"reply_to": [
person.email,
person.guardians.first().email,
],
"X-Zammad-Customer-Email": person.email,
},
context=context,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment