CHANGE_SMS : AADHAVAN

This commit is contained in:
aadhavan valli 2024-07-10 17:34:05 +05:30
parent 4483d380d2
commit 6af6d0b107
2 changed files with 8 additions and 12 deletions

View File

@ -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 . ",<br>" . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve.<br><br>" . $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()

View File

@ -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);