21 lines
737 B
Python
21 lines
737 B
Python
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()
|