$apiKey, 'MobileNo' => $mobile, 'SenderID' => $senderId, 'Message' => $message, 'ServiceName' => $serviceName, 'DLTTemplateID' => $templateId, ]); // Send request $response = @file_get_contents($url); log_message('info' , 'SMS - Response '.$response); // If response failed if ($response === FALSE) { return ['status' => 'failed', 'message' => 'Failed to send SMS.']; } return ['status' => 'success', 'message' => 'OTP sent successfully', 'api_response' => $response]; } }