def start_notification_recipients(self): """Return all recipients of the notifications. This includes both explicit recipients and, if enabled, participants of the event. """ recipients = set(self.start_notification_emails) if self.notify_participants: recipients.update(reg.email for reg in Registration.get_all_for_event(self.event)) recipients.discard('') # just in case there was an empty email address somewhere return recipients
def all_recipients(self): """Returns all recipients of the notifications. This includes both explicit recipients and, if enabled, participants of the event. """ recipients = set(self.recipients) if self.send_to_participants: recipients.update(reg.email for reg in Registration.get_all_for_event(self.event)) recipients.discard('') # just in case there was an empty email address somewhere return recipients
def all_recipients(self): """Return all recipients of the notifications. This includes both explicit recipients and, if enabled, participants/speakers of the event. """ recipients = set(self.recipients) if self.send_to_participants: recipients.update(reg.email for reg in Registration.get_all_for_event(self.event)) if self.send_to_speakers: recipients.update(person_link.email for person_link in self.event.person_links) # contribution/sub-contribution speakers are present only in meetings and conferences if self.event.type != EventType.lecture: contrib_speakers = ( ContributionPersonLink.query .filter( ContributionPersonLink.is_speaker, ContributionPersonLink.contribution.has(is_deleted=False, event=self.event) ) .all() ) subcontrib_speakers = ( SubContributionPersonLink.query .filter( SubContributionPersonLink.is_speaker, SubContributionPersonLink.subcontribution.has( db.and_( ~SubContribution.is_deleted, SubContribution.contribution.has(is_deleted=False, event=self.event) ) ) ) .all() ) recipients.update(speaker.email for speaker in contrib_speakers) recipients.update(speaker.email for speaker in subcontrib_speakers) recipients.discard('') # just in case there was an empty email address somewhere return recipients