sms
This commit is contained in:
@@ -167,9 +167,19 @@ abstract class BaseController extends Controller
|
|||||||
//
|
//
|
||||||
// curl_close($curl);
|
// curl_close($curl);
|
||||||
// return $response;
|
// return $response;
|
||||||
|
log_message('error', "SMS TO API---=>". $to_number);
|
||||||
|
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
"to"=> $to_number,
|
||||||
|
"from"=> "DigiFI",
|
||||||
|
"sms"=> "Hi there, testing 123456",
|
||||||
|
"type"=> "plain",
|
||||||
|
"channel"=> "generic",
|
||||||
|
"api_key"=> $API_KEY,
|
||||||
|
);
|
||||||
|
$post_data = json_encode($data);
|
||||||
curl_setopt_array($curl, array(
|
curl_setopt_array($curl, array(
|
||||||
CURLOPT_URL => 'https://termii.com/api/sms/send',
|
CURLOPT_URL => 'https://termii.com/api/sms/send',
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
@@ -179,23 +189,14 @@ abstract class BaseController extends Controller
|
|||||||
CURLOPT_FOLLOWLOCATION => true,
|
CURLOPT_FOLLOWLOCATION => true,
|
||||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||||
CURLOPT_CUSTOMREQUEST => 'GET',
|
CURLOPT_CUSTOMREQUEST => 'GET',
|
||||||
CURLOPT_POSTFIELDS =>'{
|
CURLOPT_POSTFIELDS => $post_data,
|
||||||
|
|
||||||
"to": $to_number,
|
|
||||||
"from": "DigiFI",
|
|
||||||
"sms": "Hi there, testing 123456",
|
|
||||||
"type": "plain",
|
|
||||||
"channel": "generic",
|
|
||||||
"api_key": $API_KEY,
|
|
||||||
|
|
||||||
}',
|
|
||||||
CURLOPT_HTTPHEADER => array(
|
CURLOPT_HTTPHEADER => array(
|
||||||
'Content-Type: application/json'
|
'Content-Type: application/json'
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = curl_exec($curl);
|
$response = curl_exec($curl);
|
||||||
|
log_message('error', "SMS TO API Response---=>". $response);
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user