diff --git a/API/Threads.php b/API/Threads.php index 421714e..a5e34e9 100644 --- a/API/Threads.php +++ b/API/Threads.php @@ -141,7 +141,13 @@ public function saveThread(Request $request, $ticketid, ContainerInterface $cont return new JsonResponse($json, Response::HTTP_OK); break; case 'reply': - $event = new CoreWorkflowEvents\Ticket\AgentReply(); + + if ($customer) { + $event = new CoreWorkflowEvents\Ticket\CustomerReply(); + } else { + $event = new CoreWorkflowEvents\Ticket\AgentReply(); + } + $event ->setTicket($ticket) ->setThread($thread)