From b85caf97463a1b47a242f42c25dae06eae25a92b Mon Sep 17 00:00:00 2001 From: Abhishek Gupta Date: Thu, 22 Jun 2023 17:25:55 +0530 Subject: [PATCH] Update in ticket reply via api to trigger mail notification : #40 --- API/Threads.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)