summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2025-06-11 13:54:42 +0000
committerMagnus Hagander2025-06-11 13:54:42 +0000
commitbe056612bed3145098aac94db6f7f71c19cb9412 (patch)
treee8cf2aed2bcf9edaf87e4002b79a6949c642bb7c
parent2ac3696fb67d5b2ada106fdec5017a908c3771cd (diff)
Add support for targeting cross-conference emails at volunteers
-rw-r--r--docs/confreg/emails.md6
-rw-r--r--postgresqleu/confreg/views.py15
2 files changed, 18 insertions, 3 deletions
diff --git a/docs/confreg/emails.md b/docs/confreg/emails.md
index 9b6e9665..0ce54f03 100644
--- a/docs/confreg/emails.md
+++ b/docs/confreg/emails.md
@@ -127,9 +127,9 @@ excluding. Include criteria are applied first, and then exclude
criteria, so exclude ones take precedence.
First pick the conference, and then either the
-[registration class](registrations#typesandclasses) or
-[speaker state](callforpapers#states). This can be done for both
-include and exclude.
+[registration class](registrations#typesandclasses),
+[speaker state](callforpapers#states) or volunteer status.
+This can be done for both include and exclude.
To add multiple either include or exclude filters, click the *+*
button. To remove an existing filter, click the *-* button.
diff --git a/postgresqleu/confreg/views.py b/postgresqleu/confreg/views.py
index 2f0ab94a..2f493afa 100644
--- a/postgresqleu/confreg/views.py
+++ b/postgresqleu/confreg/views.py
@@ -4738,6 +4738,17 @@ def crossmail_send(request):
q = "SELECT user_id, email, fullname, speakertoken FROM confreg_speaker INNER JOIN auth_user ON auth_user.id=confreg_speaker.user_id WHERE EXISTS (SELECT 1 FROM confreg_conferencesession_speaker INNER JOIN confreg_conferencesession ON confreg_conferencesession.id=conferencesession_id WHERE speaker_id=confreg_speaker.id AND conference_id={0}{1})".format(conf, sf)
if optout_filter:
q += " AND NOT EXISTS (SELECT 1 FROM confreg_conferenceseriesoptout INNER JOIN confreg_conference ON confreg_conference.series_id=confreg_conferenceseriesoptout.series_id WHERE confreg_conferenceseriesoptout.user_id=confreg_speaker.user_id AND confreg_conference.id={0})".format(int(conf))
+ elif t == 'vol':
+ # Volunteers
+ q = "SELECT attendee_id, email, firstname || ' ' || lastname, regtoken FROM confreg_conferenceregistration r WHERE r.conference_id={0} AND r.payconfirmedat IS NOT NULL ".format(conf)
+ if v == "0":
+ # General volunteer
+ q += "AND EXISTS (SELECT 1 FROM confreg_conference_volunteers cv WHERE cv.conference_id={} AND cv.conferenceregistration_id=r.id)".format(conf)
+ elif v == "1":
+ # Check-in processor
+ q += "AND EXISTS (SELECT 1 FROM confreg_conference_checkinprocessors cc WHERE cc.conference_id={} AND cc.conferenceregistration_id=r.id)".format(conf)
+ else:
+ raise Exception("Invalid filter value")
else:
raise Exception("Invalid filter type")
return q
@@ -4883,6 +4894,10 @@ def crossmailoptions(request):
{'id': 'sp:{0}'.format(k), 'title': 'Speaker: {0}'.format(v)}
for k, v in STATUS_CHOICES
])
+ r.extend([
+ {'id': 'vol:0', 'title': 'Volunteers'},
+ {'id': 'vol:1', 'title': 'Check-in processors'},
+ ])
return HttpResponse(json.dumps(r), content_type="application/json")