HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/sarvodayahospital/app/Sms.php
<?php

namespace app;

use GuzzleHttp\Client;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Facades\Http;

/**
 * Class Sms to send SMS on Mobile Numbers.
 *
 * @author Subhendu Giri
 */
class Sms
{
    public function __construct()
    {
    }

    private $SMS_USER = 't1sarvodayahospitalapi';
    private $SMS_PASS = 'Rabrakha2023';
    private $SMS_SENDER_ID = 'SRVDYA';
    private $SMS_ENTITY_ID = '1701158056165732117';
    private $SMS_TEMPLATE_ID = '1507166866175416818';
    private $RESPONSE_TYPE = 'json';

    public function sendOTP($OTP, $mobileNumber)
    {
        $isError = 0;
        $errorMessage = true;

        // $message = urlencode($OTP.' is your One Time Password to login into your Sarvodaya Healthcare account. Please do not share your OTP with anyone. Thank You');

        $message = urlencode($OTP.' is your One Time Password to login into your Sarvodaya Healthcare account. Please do not share your OTP with anyone. Thank You');

        try {
            // $smsURL = 'http://nimbusit.co.in/api/swsendSingle.asp?username=t1sarvodayahospitalapi&password=Rabrakha2023&sender=SRVDYA&sendto='.$mobileNumber.'&entityID=1701158056165732117&templateID=1507166866175416818&message='.$message;

            $smsURL = 'https://nimbusit.biz/api/SmsApi/SendSingleApi?UserID=sarvodayahbiz&Password=mfmy5236MF&SenderID=SRVDYA&EntityID=1701158056165732117&Phno='.$mobileNumber.'&TemplateID=1507166866175416818&Msg='.$message;

            $response = Http::get($smsURL);

            info('SMS API');
            info($response);

            return $response->ok();
        } catch (ConnectionException $exception) {
            return 'Connection not established';
        }
    }

    public function sendWhatsAppConfirmationSMS($mobileNumber) {
        $url = "https://sarvodayahospital19.com/pdm/API_NOIDA/nursing_conclave";

        $client   = new Client();
        $response = $client->post($url, [
            'form_params' => [
                'mobile' => $mobileNumber
            ],
        ]);

        return json_decode($response->getBody(), true);
    }

    public function sendConfirmation($mobileNumber, $patient_name, $doctor_name, $date_time, $hospital_name, $appointment_id, $help_line)
    {
        $isError = 0;
        $errorMessage = true;
        $message = urlencode('Dear '.$patient_name.', your appointment with '.$doctor_name.' has been confirmed for '.$date_time.' at '.$hospital_name.';  Appointment id: '.$appointment_id.'; For any assistance, please call '.$help_line.' SRVDYA ');
        try {
            $smsURL = 'http://nimbusit.co.in/api/swsendSingle.asp?username=t1sarvodayahospitalapi&password=Rabrakha21&sender=SRVDYA&sendto='.$mobileNumber.'&entityID=1701158056165732117&templateID=1507167447614026495&message='.$message;
            //return $smsURL;
            $response = Http::get($smsURL);

            return $response->ok();
        } catch (ConnectionException $exception) {
            return 'Connection not established';
        }
    }
}