diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index 8689d17..5c74073 100644 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -802,16 +802,12 @@ 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; $mail_send = $MailHelper->send_url_email($clientData->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){ @@ -826,7 +822,7 @@ class MasterController extends BaseController public function doc_generate_otp() { - try { + // try { $mobile_no = $this->request->getPost('mobile_no'); $client_data = $this->ClientBranchModel->where('mobile_no', $mobile_no )->first(); if($client_data){ @@ -850,17 +846,17 @@ class MasterController extends BaseController // $notificationHelper->sendWhatsAppMessage($number, $message); } if($client_data['sms'] == 1){ - $notificationHelper->sendSms($number, $client_data['name'] , $otp, '', 'doc_verify',$clint_full_data); + $data = $notificationHelper->sendSms($number, $client_data['name'] , $otp, '', 'doc_verify',$clint_full_data); } - return $this->respond(['success' => true, 'otp' => $otp]); + return $this->respond(['success' => true]); } } else { return false; } - } catch (\Exception $e) { - // Handle any exceptions that occur during execution - return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500); - } + // } catch (\Exception $e) { + // // Handle any exceptions that occur during execution + // return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500); + // } } public function doc_verify_otp() diff --git a/app/Helpers/NotificationHelper.php b/app/Helpers/NotificationHelper.php index 83894c5..db23219 100644 --- a/app/Helpers/NotificationHelper.php +++ b/app/Helpers/NotificationHelper.php @@ -94,6 +94,7 @@ class NotificationHelper $message = 'Dear '. substr($client_name, 0, 20) .', '. $otp .' is OTP to approve '. $client_full_data['group_name'] .' for '. $client_full_data['service_name'] .' purposes. -L D RAJ AND CO'; } + $serviceName = getenv('SERVICE_NAME'); // Service name // URL encode the message @@ -108,7 +109,6 @@ class NotificationHelper // Execute cURL request and get the response $output = curl_exec($ch); - // Close cURL session curl_close($ch);