-
backend/app/Jobs/Event/SendMessagesJob.php
Open in GitHubuse HiEvents\Exceptions\UnableToSendMessageException; use HiEvents\Services\Domain\Mail\SendEventEmailMessagesService; use HiEvents\Services\Handlers\Message\DTO\SendMessageDTO; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; class SendMessagesJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; private SendMessageDTO $messageData; public function __construct(SendMessageDTO $messageData) { $this->messageData = $messageData; } public function handle(SendEventEmailMessagesService $emailMessagesService): void { $emailMessagesService->send($this->messageData); } }
-
backend/app/Http/Actions/Orders/MessageOrderAction.php
Open in GitHubuse HiEvents\DomainObjects\EventDomainObject; use HiEvents\Http\Actions\BaseAction; use HiEvents\Http\Request\Message\SendMessageRequest; use HiEvents\Jobs\Event\SendMessagesJob; use Illuminate\Http\Response; class MessageOrderAction extends BaseAction { public function __invoke(SendMessageRequest $request, int $eventId, int $orderId): Response { $this->isActionAuthorized($eventId, EventDomainObject::class); SendMessagesJob::dispatch($orderId, $request->input('subject'), $request->input('message')); return $this->noContentResponse(); } }