From 5f95fa8399991399a1a25adaee2fad28a12eb248 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Thu, 21 Aug 2025 17:33:24 +0530 Subject: [PATCH] CHANGE_TICKETING_SYSTEM - VADIVEL J 2025-08-21 --- app/Controllers/ThzController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index 093d6b2c..6dce2803 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -117,13 +117,18 @@ class ThzController extends BaseController return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404); } - $emailNotificationResult = $this->ticketConversationSaveNotification($data); + if($data['notes_type'] == "External"){ + $emailNotificationResult = $this->ticketConversationSaveNotification($data); + }else{ + $emailNotificationResult = false ; + } + return $this->response->setJSON([ 'status' => $result ? 'success' : 'error', 'message' => $result ? "Ticket Notes created successfully" : "Unable to create ticket notes. Please try again." , - 'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed..!!' + 'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed Or No Need..!!' ])->setStatusCode($result ? 200 : 400); } @@ -184,6 +189,7 @@ class ThzController extends BaseController }else{ return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404); } + if ($returnType === 'api') {