From d7bbcb562a1e812b0b82201311b80d1c4c90cbb9 Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Wed, 10 Jul 2024 12:04:50 +0530 Subject: [PATCH] CHANGE_MAIL_APPROVE_3 : AADHAVAN --- app/Controllers/MasterController.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index 58ce33c..3d40b70 100644 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -783,7 +783,7 @@ class MasterController extends BaseController public function rememeber_notification() { - // try { + try { $doc_id = $this->request->getPost('doc_id'); $MailHelper = new MailHelper(); @@ -802,9 +802,16 @@ class MasterController extends BaseController $businessData = $this->BusinessModel->select('business.*') ->where('business.business_id',$this->session->get('logged_in_staff_business_id')) ->get()->getRow(); + echo $clientData->email; + echo $businessData->business_name; + echo $url; $subject = 'BB-Sign Verify Document'; $message = "Dear " . $clientData->client_name . ",
" . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve.

" . $url; - $MailHelper->send_url_email($clientData->email , '', $subject, $message); + $mail_send = $MailHelper->send_url_email('' , '', $subject, $message); + if (!$mail_send) { + throw new \Exception('Email sending failed.'); + } + print_r($mail_send); $notificationHelper = new NotificationHelper(); $number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number if($clientData->whatsapp == 1){ @@ -812,9 +819,9 @@ class MasterController extends BaseController //$notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url); } return $this->respond(['success' => true, 'data' => 'Remember Send Successfully']); - // } catch (\Exception $exception) { - // return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500); - // } + } catch (\Exception $exception) { + return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500); + } } public function doc_generate_otp()