使用 vTiger 实例发送短信

Send SMS using vTiger instance

<?php
include_once 'vtlib/Vtiger/Utils.php';
require_once('include/database/PearDatabase.php');
require_once 'config.inc.php';
require_once 'includes/Loader.php';
require_once 'modules/SMSNotifier/SMSNotifier.php';
vimport ('includes.runtime.EntryPoint');

$user = Users_Record_Model::getCurrentUserModel();
GLOBAL $adb;

$tonumbers = array('994255xxxx');
$message = "Test From Ramesh";

$provider = SMSNotifierManager::getActiveProviderInstance();
if( $provider ){
    $provider->send($message, $tonumbers);
}
?>

使用 getActiveProviderInstance 获取提供者实例。并从该实例调用发送函数。

试试这个

<?php
include_once 'includes/main/WebUI.php';
require_once 'includes/Loader.php';
require_once 'modules/SMSNotifier/SMSNotifier.php';
$tonumbers = array('994255xxxx');
$message = "Test From Ramesh";
SMSNotifier::fireSendSMS($message, $tonumbers);