Skip to content

Commit be05661

Browse files
committed
Add support for targeting cross-conference emails at volunteers
1 parent 2ac3696 commit be05661

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

docs/confreg/emails.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ excluding. Include criteria are applied first, and then exclude
127127
criteria, so exclude ones take precedence.
128128

129129
First pick the conference, and then either the
130-
[registration class](registrations#typesandclasses) or
131-
[speaker state](callforpapers#states). This can be done for both
132-
include and exclude.
130+
[registration class](registrations#typesandclasses),
131+
[speaker state](callforpapers#states) or volunteer status.
132+
This can be done for both include and exclude.
133133

134134
To add multiple either include or exclude filters, click the *+*
135135
button. To remove an existing filter, click the *-* button.

postgresqleu/confreg/views.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4738,6 +4738,17 @@ def _get_one_filter(conf, filt, optout_filter=False):
47384738
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)
47394739
if optout_filter:
47404740
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))
4741+
elif t == 'vol':
4742+
# Volunteers
4743+
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)
4744+
if v == "0":
4745+
# General volunteer
4746+
q += "AND EXISTS (SELECT 1 FROM confreg_conference_volunteers cv WHERE cv.conference_id={} AND cv.conferenceregistration_id=r.id)".format(conf)
4747+
elif v == "1":
4748+
# Check-in processor
4749+
q += "AND EXISTS (SELECT 1 FROM confreg_conference_checkinprocessors cc WHERE cc.conference_id={} AND cc.conferenceregistration_id=r.id)".format(conf)
4750+
else:
4751+
raise Exception("Invalid filter value")
47414752
else:
47424753
raise Exception("Invalid filter type")
47434754
return q
@@ -4883,6 +4894,10 @@ def crossmailoptions(request):
48834894
{'id': 'sp:{0}'.format(k), 'title': 'Speaker: {0}'.format(v)}
48844895
for k, v in STATUS_CHOICES
48854896
])
4897+
r.extend([
4898+
{'id': 'vol:0', 'title': 'Volunteers'},
4899+
{'id': 'vol:1', 'title': 'Check-in processors'},
4900+
])
48864901
return HttpResponse(json.dumps(r), content_type="application/json")
48874902

48884903

0 commit comments

Comments
 (0)