Manual mails can be sent

This commit is contained in:
2026-04-18 20:52:13 +02:00
parent ed7f887e3a
commit ff98f0860c
235 changed files with 151212 additions and 50 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Domains\Event\Controllers\MailCompose;
use App\Scopes\CommonController;
use Illuminate\Http\Request;
class ByGroupController extends CommonController
{
public function __invoke(string $eventIdentifier, string $groupType, Request $request) {
$event = $this->events->getByIdentifier($eventIdentifier, true);
$recipients = [];
switch ($groupType) {
case 'by-local-group':
$participants = $this->eventParticipants->groupByLocalGroup($event, $request, $request->input('groupName'));
$recipients = $this->eventParticipants->getMailAddresses($participants[$request->input('groupName')]);
break;
case 'by-participation-group':
$participants = $this->eventParticipants->groupByParticipationType($event, $request, $request->input('groupName'));
$recipients = $this->eventParticipants->getMailAddresses($participants[$request->input('groupName')]);
break;
case 'signed-off':
$participants = $this->eventParticipants->getSignedOffParticipants($event, $request, $request->input('groupName'));
$recipients = $this->eventParticipants->getMailAddresses($participants[$request->input('groupName')]);
break;
default:
$participants = $this->eventParticipants->getForList($event, $request);
$recipients = $this->eventParticipants->getMailAddresses($participants);
}
return response()->json(['recipients' => $recipients]);
}
}