settings updates, fixed

This commit is contained in:
Mark Gregory
2026-08-25 22:30:59 +01:00
parent 1cad54ce42
commit d359ac29b6
13 changed files with 61 additions and 815 deletions
@@ -69,7 +69,7 @@ final class WorkflowNotificationService
*/
private function hydrateTicketUsers(Ticket $ticket): void
{
if ($ticket->relationLoaded('owner') && $ticket->relationLoaded('agent')) {
if ($ticket->relationLoaded('user') && $ticket->relationLoaded('agent')) {
return;
}
@@ -81,7 +81,6 @@ final class WorkflowNotificationService
if ($userIds->isEmpty()) {
$ticket->setRelation('user', null);
$ticket->setRelation('owner', null);
$ticket->setRelation('agent', null);
return;
@@ -96,7 +95,6 @@ final class WorkflowNotificationService
$agent = $ticket->agent_id === null ? null : $users->get((int) $ticket->agent_id);
$ticket->setRelation('user', $owner);
$ticket->setRelation('owner', $owner);
$ticket->setRelation('agent', $agent);
}
@@ -105,7 +103,7 @@ final class WorkflowNotificationService
return match ($role) {
'agent' => $ticket->agent,
'actor' => $actor,
default => $ticket->owner,
default => $ticket->user,
};
}
@@ -119,7 +117,7 @@ final class WorkflowNotificationService
'{{ ticket.category }}' => (string) ($ticket->category?->name ?? ''),
'{{ ticket.project }}' => (string) ($ticket->project?->title ?? ''),
'{{ ticket.team }}' => (string) ($ticket->team?->name ?? ''),
'{{ requester.name }}' => (string) ($ticket->owner?->name ?? ''),
'{{ requester.name }}' => (string) ($ticket->user?->name ?? ''),
'{{ agent.name }}' => (string) ($ticket->agent?->name ?? ''),
'{{ actor.name }}' => (string) ($actor?->name ?? ''),
'{{ ticket.url }}' => route('helpdesk.tickets.show', ['ticket' => $ticket->getKey()]),