Manual mails can be sent
This commit is contained in:
@@ -39,31 +39,37 @@ class EventParticipantRepository {
|
||||
return $participant;
|
||||
}
|
||||
|
||||
public function groupByLocalGroup(Event $event, Request $request) : array {
|
||||
public function groupByLocalGroup(Event $event, Request $request, ?string $filter = null) : array {
|
||||
$allParticipants = $this->getForList($event, $request);
|
||||
$participants = [];
|
||||
foreach ($allParticipants as $participant) {
|
||||
$participants[$participant['localgroup']][] = $participant;
|
||||
if ($filter === null || $participant['localgroup'] === $filter) {
|
||||
$participants[$participant['localgroup']][] = $participant;
|
||||
}
|
||||
}
|
||||
|
||||
return $participants;
|
||||
}
|
||||
|
||||
public function groupByParticipationType(Event $event, Request $request) : array {
|
||||
public function groupByParticipationType(Event $event, Request $request, ?string $filter = null) : array {
|
||||
$allParticipants = $this->getForList($event, $request);
|
||||
$participants = [];
|
||||
foreach ($allParticipants as $participant) {
|
||||
$participants[$participant['participationType']][] = $participant;
|
||||
if ($filter === null || $participant['participationType'] === $filter) {
|
||||
$participants[$participant['participationType']][] = $participant;
|
||||
}
|
||||
}
|
||||
|
||||
return $participants;
|
||||
}
|
||||
|
||||
public function getSignedOffParticipants(Event $event, Request $request) : array {
|
||||
public function getSignedOffParticipants(Event $event, Request $request, ?string $filter = null) : array {
|
||||
$allParticipants = $this->getForList($event, $request, true);
|
||||
$participants = [];
|
||||
foreach ($allParticipants as $participant) {
|
||||
$participants[$participant['participationType']][] = $participant;
|
||||
if ($filter === null || $participant['participationType'] === $filter) {
|
||||
$participants[$participant['participationType']][] = $participant;
|
||||
}
|
||||
}
|
||||
|
||||
return $participants;
|
||||
@@ -147,4 +153,18 @@ class EventParticipantRepository {
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getMailAddresses(array $participants) : array {
|
||||
$mailAddresses = [];
|
||||
foreach ($participants as $participant) {
|
||||
if (!in_array($participant['email_1'], $mailAddresses)) {
|
||||
$mailAddresses[] = $participant['email_1'];
|
||||
}
|
||||
|
||||
if ($participant['email_2'] !== null && !in_array($participant['email_2'], $mailAddresses)) {
|
||||
$mailAddresses[] = $participant['email_2'];
|
||||
}
|
||||
}
|
||||
return $mailAddresses;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user