Move notification event type onto events
This commit is contained in:
@@ -12,11 +12,12 @@ class QueueNotificationEventDeliveries
|
||||
public function handle(NotificationEvent $event): void
|
||||
{
|
||||
$payload = $event->payload();
|
||||
$eventType = $event->eventType();
|
||||
|
||||
NotificationAction::query()
|
||||
->enabled()
|
||||
->where('project_id', $payload->projectId())
|
||||
->where('event_type', $payload->eventType()->value)
|
||||
->where('event_type', $eventType->value)
|
||||
->get(['channel', 'id'])
|
||||
->each(function (NotificationAction $notificationAction) use ($event, $payload): void {
|
||||
$notificationDeliveryLogId = null;
|
||||
@@ -26,7 +27,7 @@ class QueueNotificationEventDeliveries
|
||||
'attempt_count' => 0,
|
||||
'channel' => $notificationAction->channel,
|
||||
'delivery_status' => NotificationDeliveryStatus::Pending,
|
||||
'event_type' => $payload->eventType(),
|
||||
'event_type' => $event->eventType(),
|
||||
'notification_action_id' => $notificationAction->id,
|
||||
'payload_metadata' => $payload->deliveryMetadata(),
|
||||
])->id;
|
||||
|
||||
Reference in New Issue
Block a user