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') {