summaryrefslogtreecommitdiff
path: root/postgresqleu/confreg/util.py
diff options
context:
space:
mode:
authorMagnus Hagander2018-12-19 13:31:23 +0000
committerMagnus Hagander2018-12-19 13:39:11 +0000
commit88ede325b9f6bedd12cc9d8f9453a45a9e28a794 (patch)
tree651b80d171a4188673ab925b1d06c14c716a7d4e /postgresqleu/confreg/util.py
parent7cac765c3b90d21ab01517f1fe39c86dc8213279 (diff)
Add support for emailing individual attendees
* Add the ability to track emails against individual attendees and not just registration classes. * Add the ability to track emails to users who are not yet registered (but they must have a user account as that's what we track against). These emails gets automatically attached to the registration once the user registers. * Add support to the registration dashboard listing for ticking of attendees to send email to, and to send it. * Add generic support to the admin backend for the same, and enable this support for sessions (more can be adde din the future). * Change the admin list of emails to collapse when there are many emails sent, and not overflow the screen. This as it's more likely that many emails are sent now. Create a file called admin.js for this -- more should probably be migrated over to this file instead of living in individual HTML files, but that's for a later commit.
Diffstat (limited to 'postgresqleu/confreg/util.py')
-rw-r--r--postgresqleu/confreg/util.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/postgresqleu/confreg/util.py b/postgresqleu/confreg/util.py
index 97708573..479b417f 100644
--- a/postgresqleu/confreg/util.py
+++ b/postgresqleu/confreg/util.py
@@ -11,6 +11,7 @@ from postgresqleu.util.middleware import RedirectException
from models import PrepaidVoucher, DiscountCode, RegistrationWaitlistHistory
from models import ConferenceRegistration, Conference
+from models import AttendeeMail
class InvoicerowsException(Exception):
@@ -136,6 +137,14 @@ def notify_reg_confirmed(reg, updatewaitlist=True):
receivername=reg.fullname,
)
+ # If the registration has a user account, we may have email to connect
+ # to this registration.
+ if reg.attendee:
+ for m in AttendeeMail.objects.filter(conference=reg.conference,
+ pending_regs=reg.attendee):
+ m.pending_regs.remove(reg.attendee)
+ m.registrations.add(reg)
+
# Do we need to send the welcome email?
if not reg.conference.sendwelcomemail:
return