UPD: added app to submit participant registrations.
This commit is contained in:
20
dav_registration/signals.py
Normal file
20
dav_registration/signals.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.dispatch import Signal
|
||||
|
||||
from . import emails
|
||||
|
||||
registration_created = Signal(providing_args=['registration'])
|
||||
|
||||
|
||||
def send_emails_on_registration(sender, **kwargs):
|
||||
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 = u'"{fullname}" <{email}>'.format(fullname=registration.get_full_name(),
|
||||
email=registration.email_address)
|
||||
email = emails.InformSelfRegistrationMail(recipient=recipient, registration=registration)
|
||||
email.send()
|
||||
Reference in New Issue
Block a user