Skip to content

Commit

Permalink
Some changes send email when customer and agent reply on tickets: uvd…
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi12-gupta committed Jun 28, 2023
1 parent 2b619fd commit f22ad47
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions API/Threads.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,19 @@ public function saveThread(Request $request, $ticketid, ContainerInterface $cont
return new JsonResponse($json, Response::HTTP_OK);
break;
case 'reply':
$event = new CoreWorkflowEvents\Ticket\AgentReply();
$event
->setTicket($ticket)
->setThread($thread)
;
if ($thread->getcreatedBy() == 'customer') {
$event = new CoreWorkflowEvents\Ticket\CustomerReply();
$event
->setTicket($ticket)
->setThread($thread)
;
} else {
$event = new CoreWorkflowEvents\Ticket\AgentReply();
$event
->setTicket($ticket)
->setThread($thread)
;
}

$container->get('event_dispatcher')->dispatch($event, 'uvdesk.automation.workflow.execute');

Expand Down

0 comments on commit f22ad47

Please sign in to comment.