Files
django-dav-events/dav_registration/signals.py
heinzel 98a6fc3ce7
All checks were successful
buildbot/tox Build done.
try to make pylint happy
2022-06-08 00:08:09 +02:00

21 lines
770 B
Python

from django.dispatch import Signal
from . import emails
registration_created = Signal(providing_args=['registration'])
def send_emails_on_registration(sender, **kwargs): # pylint: disable=unused-argument
registration = kwargs.get('registration')
# Inform the event owner (trainer)
recipient = registration.event.owner
email = emails.InformTrainerRegistrationMail(recipient=recipient, registration=registration)
email.send()
# Inform the potential participant
recipient = '"{fullname}" <{email}>'.format(fullname=registration.get_full_name(),
email=registration.email_address)
email = emails.InformSelfRegistrationMail(recipient=recipient, registration=registration)
email.send()