PHP code example of tongso / notice-message

1. Go to this page and download the library: Download tongso/notice-message library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tongso / notice-message example snippets


composer 

return [
    //手机短信
    "shortMessage" => [
        //当前使用的短信接口服务商
        "defaultVendor" => "aliyun",
        //各服务商接口参数配置,每个服务商接口验证参数可能不一样
        "apiConfigs" => [
            "aliyun" => [
                "accessKeyId" => '',
                "accessSecret" => '',
                "signName" => 'MrByte.cn',
                "regionId" => 'cn-hangzhou',//阿里默认值
                "host" => 'dysmsapi.aliyuncs.com'//阿里默认值
            ],
            "juhe" => [
                "apiKey" => ''
            ]
        ]
    ]
];

NoticeMessage::sendSms("手机号码", "短信模板ID", "短信模板中的变量值", "短信服务商名称");