HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/crm.chaitanyahospitalvirar.com/application/libraries/Msgnineone.php
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class Msgnineone
{

    private $_CI;
    public $route    = "4";
    public $authKey  = "";
    public $senderId = "";
    public $url      = "https://control.msg91.com/api/sendhttp.php";

    public function __construct($array)
    {
        $this->_CI = &get_instance();

        $this->authKey  = $array['authkey'];
        $this->senderId = $array['senderid'];
    }

    public function sendSMS($to, $message, $template_id)
    {

        $DLT_TE_ID = $template_id;
        $postData  = array(
            'authkey'   => $this->authKey,
            'mobiles'   => $to,
            'message'   => $message,
            'sender'    => $this->senderId,
            'route'     => $this->route,
            'DLT_TE_ID' => $DLT_TE_ID,
        );      

        $ch = curl_init();
        curl_setopt_array($ch, array(
            CURLOPT_URL            => $this->url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_POST           => true,
            CURLOPT_POSTFIELDS     => $postData,
            //,CURLOPT_FOLLOWLOCATION => true
        ));
        //Ignore SSL certificate verification
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

        //get response
        $output = curl_exec($ch);

        //Print error if any
        if (curl_errno($ch)) {
            //echo 'error:' . curl_error($ch);
        }
        curl_close($ch);

        return true;
    }

}