membershipworks: Only send event survey emails to non-voided participants
This commit is contained in:
parent
350dc4e1ee
commit
bd1e009cc2
@ -23,7 +23,15 @@ class EventSurveyEmail(TemplatedMultipartEmail):
|
||||
|
||||
@classmethod
|
||||
def render_for_event(cls, event: EventExt) -> Iterable[mail.EmailMessage]:
|
||||
for name, email in event.attendees.values_list("name", "email"):
|
||||
# not using event.attendees because that makes getting ticket count harder
|
||||
for attendee in event.details["usr"]:
|
||||
# skip users with no tickets, as they were Voided
|
||||
if sum(attendee["tkt"]) == 0:
|
||||
continue
|
||||
|
||||
name = attendee["nam"]
|
||||
email = attendee["eml"]
|
||||
|
||||
sanitized_email = mail.message.sanitize_address(
|
||||
(name, email), settings.DEFAULT_CHARSET
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user