d46ac961 by G Manojkumar

new SmsTemplate and sms to send DB

1 parent 5a3827d2
<?php
define('SMS_NOTCONTACTED',1);
define('SMS_THANKYOU',2);
$smsContactedSubdispositionsArr = array ('Contacted');
$smsContactedSubdispositionsArr = array ('Contacted','Feedback');
$smsNotContactedSubdispositionsArr = array (
'NC - Customer Traveling / Abroad',
'NC - Customer in Meeting',
......@@ -12,8 +12,16 @@
);
$smsTemplatesArr = array(
//SMS_NOTCONTACTED => "Dear Customer,Your Virtual Relationship Manager #name# from HDFC Bank tried reaching you. Kindly call #number# for all your banking and financial needs",
SMS_NOTCONTACTED =>"Dear Customer, Your Virtual RM #name# from HDFC Bank tried reaching you. Kindly call 022#number# for all your banking and financial needs.",
//SMS_NOTCONTACTED =>"Dear Customer, Your Virtual RM #name# from HDFC Bank tried reaching you. Kindly call #number# for all your banking and financial needs.",
SMS_NOTCONTACTED =>"Your RM is unable to contact you!
Call #name# @ #number# for any banking need.
Check & invest in our FD/RD @best rate.
Click here: bit.ly/2TqCdKA",
//SMS_THANKYOU =>"Thank you for speaking to your VirtualRM on #date# . Now also access your account 24/7 via NetBanking/MobileBanking. Download MobileBanking App: bit.ly/2ajTksK"
SMS_THANKYOU =>"Thank you for speaking to your Virtual RM on #date#. Now also access your account 24/7 via Net / Mobile Banking. Download Mobile App: bit.ly/2ajTksK"
//SMS_THANKYOU =>"Thank you for speaking to your Virtual RM on #date#. Now also access your account 24/7 via Net / Mobile Banking. Download Mobile App: bit.ly/2ajTksK"
SMS_THANKYOU =>"Your opinion matters!
Thanks for talking & sharing your feedback on #number# with RM #name#
Check & invest in our FD/RD @best rate
Click: bit.ly/2TqCdKA"
);
?>
......
......@@ -4,23 +4,31 @@ use Illuminate\Http\Request;
use App\Http\Requests;
use Auth;
use Log;
use DB;
class SmsController extends Controller
{
public $smsUrl = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
//public $userarray = array("A21568","admin");
public function sendSmsBasedOnSubDisposition($kstychCall)
{
//public $userarray = array("A21568","admin");
//$users = $this->userarray;
//Log::info(Auth::user()->username." ^ ".$users[0]);
//Log::info(in_array(Auth::user()->username , $users));
//if(in_array(Auth::user()->username , $users)){
$msgText = $this->getSmsTemplate($kstychCall);
if( !empty($msgText) ) {
$msgText = $this->fillValuesInTemplate($msgText);
Log::info($msgText);
//Log::info($msgText);
$this->sendSmsRequest($kstychCall, $msgText);
}
//}
return;
}
public function sendSmsRequest($kstychCall, $msgText)
{
$url = $this->smsUrl;
Log::info($kstychCall['callnumber']);
//Log::info($kstychCall['callnumber']);
$inputArray = [
'userId'=>'hdfcbalrt',
"pass"=>'hdfcbalrt25',
......@@ -43,7 +51,15 @@ class SmsController extends Controller
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Log::info($response);
$number=$kstychCall['callnumber'];
$callid=intval($kstychCall['callid'])+0;
$serverip=env(app_ip);
$rmname=Auth::user()->fullname;
$subdispo=$kstychCall["usersubstatus"];
DB::insert(DB::raw("insert into sms_log set server_ip='$serverip',call_id='$callid',rm_name='$rmname',subdispo='$subdispo',number='$number',message='$msgText',response='$response'"));
Log::useFiles(storage_path().'/logs/SMS_Messages_'.date("Y-m-d").'.log');
Log::info('|'.env(app_ip).'|'.date('Y-m-d H:i:s', strtotime('+5 hours 30 minutes')).'|'.Auth::user()->fullname.'|'.$kstychCall['callnumber'].'|"'.$msgText.'"|'.$response.'|');
//Log::info($response);
curl_close($ch);
} catch(Exception $e) {
Log::info($e->getMessage());
......@@ -73,7 +89,7 @@ class SmsController extends Controller
$extenArr = explode(":", $extension);
$exten = $extenArr[0];
}
Log::info($exten);
//Log::info($exten);
$msgText = str_replace("#number#", $exten, $msgText);
$msgText = str_replace("#date#", date('d-m-Y'), $msgText);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!