CHANGE_SMS : AADHAVAN
This commit is contained in:
parent
4483d380d2
commit
6af6d0b107
@ -802,16 +802,12 @@ class MasterController extends BaseController
|
|||||||
$businessData = $this->BusinessModel->select('business.*')
|
$businessData = $this->BusinessModel->select('business.*')
|
||||||
->where('business.business_id',$this->session->get('logged_in_staff_business_id'))
|
->where('business.business_id',$this->session->get('logged_in_staff_business_id'))
|
||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
echo $clientData->email;
|
|
||||||
echo $businessData->business_name;
|
|
||||||
echo $url;
|
|
||||||
$subject = 'BB-Sign Verify Document';
|
$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;
|
$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);
|
$mail_send = $MailHelper->send_url_email($clientData->email , '', $subject, $message);
|
||||||
if (!$mail_send) {
|
if (!$mail_send) {
|
||||||
throw new \Exception('Email sending failed.');
|
throw new \Exception('Email sending failed.');
|
||||||
}
|
}
|
||||||
print_r($mail_send);
|
|
||||||
$notificationHelper = new NotificationHelper();
|
$notificationHelper = new NotificationHelper();
|
||||||
$number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number
|
$number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number
|
||||||
if($clientData->whatsapp == 1){
|
if($clientData->whatsapp == 1){
|
||||||
@ -826,7 +822,7 @@ class MasterController extends BaseController
|
|||||||
|
|
||||||
public function doc_generate_otp()
|
public function doc_generate_otp()
|
||||||
{
|
{
|
||||||
try {
|
// try {
|
||||||
$mobile_no = $this->request->getPost('mobile_no');
|
$mobile_no = $this->request->getPost('mobile_no');
|
||||||
$client_data = $this->ClientBranchModel->where('mobile_no', $mobile_no )->first();
|
$client_data = $this->ClientBranchModel->where('mobile_no', $mobile_no )->first();
|
||||||
if($client_data){
|
if($client_data){
|
||||||
@ -850,17 +846,17 @@ class MasterController extends BaseController
|
|||||||
// $notificationHelper->sendWhatsAppMessage($number, $message);
|
// $notificationHelper->sendWhatsAppMessage($number, $message);
|
||||||
}
|
}
|
||||||
if($client_data['sms'] == 1){
|
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 {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
// } catch (\Exception $e) {
|
||||||
// Handle any exceptions that occur during execution
|
// // Handle any exceptions that occur during execution
|
||||||
return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500);
|
// return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doc_verify_otp()
|
public function doc_verify_otp()
|
||||||
|
|||||||
@ -94,6 +94,7 @@ class NotificationHelper
|
|||||||
$message = 'Dear '. substr($client_name, 0, 20) .',
|
$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';
|
'. $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
|
$serviceName = getenv('SERVICE_NAME'); // Service name
|
||||||
|
|
||||||
// URL encode the message
|
// URL encode the message
|
||||||
@ -108,7 +109,6 @@ class NotificationHelper
|
|||||||
|
|
||||||
// Execute cURL request and get the response
|
// Execute cURL request and get the response
|
||||||
$output = curl_exec($ch);
|
$output = curl_exec($ch);
|
||||||
|
|
||||||
// Close cURL session
|
// Close cURL session
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user