Update README.md

master
qcloudsms 6 years ago
parent 5f8ae50022
commit 578e4b2666
  1. 18
      README.md
  2. 6
      docs/Qcloud/Sms/SmsMultiSender.html
  3. 2
      docs/renderer.index
  4. 2
      src/FileVoiceSender.php
  5. 2
      src/TtsVoiceSender.php
  6. 2
      src/VoiceFileUploader.php

@ -74,7 +74,7 @@ qcloudsms_php采用composer进行安装,要使用qcloudsms功能,只需要
1. 手动下载或clone最新版本qcloudsms_php代码
2. 把qcloudsms_php放入项目目录
3. `require` qcloudsms_php src目录下面的index.php,即可使用, 如把qcloudsms放在当前目录下,只需要:
3. `require` qcloudsms_php src目录下面的index.php,即可使用如把qcloudsms放在当前目录下,只需要:
```php
require __DIR__ . "/qcloudsms_php/src/index.php";
@ -268,9 +268,12 @@ try {
海外短信与国内短信发送类似, 发送海外短信只需替换相应国家码。
- **上传语音文件**
```php
use Qcloud\Sms\VoiceFileUploader;
try {
$filepath = "path/to/example.mp3";
$fileContent = file_get_contents($filepath);
@ -281,6 +284,7 @@ try {
$contentType = VoiceFileUploader::MP3;
$uploader = new VoiceFileUploader($appid, $appkey);
$result = $uploader->upload($fileContent, $contentType);
// 上传成功后,$rsp里会带有语音文件的fid
$rsp = json_decode($result);
echo $result;
} catch (\Exception $e) {
@ -288,12 +292,17 @@ try {
}
```
> `Note` 语音文件上传功能需要联系腾讯云短信技术支持(QQ:3012203387),才能开通
> `Note` '语音文件上传'功能需要联系腾讯云短信技术支持(QQ:3012203387)才能开通
- **按语音文件fid发送语音通知**
```php
use Qcloud\Sms\FileVoiceSender;
try {
// 注:这里$fid来自`上传语音文件`接口返回的响应,要按语音
// 文件fid发送语音通知,需要先上传语音文件获取$fid
$fid = "73844bb649ca38f37e596ec2781ce6a56a2a3a1b.mp3";
$fvsender = new FileVoiceSender($appid, $appkey);
$result = $fvsender->send("86", $phoneNumbers[0], $fid);
@ -304,11 +313,14 @@ try {
}
```
> `Note` 按语音文件fid发送语音通知功能需要联系腾讯云短信技术支持(QQ:3012203387),才能开通
> `Note` 按'语音文件fid发送语音通知'功能需要联系腾讯云短信技术支持(QQ:3012203387)才能开通
- **指定模板发送语音通知类**
```php
use Qcloud\Sms\TtsVoiceSender;
try {
$templateId = 1013;
$params = ["54321"];

@ -109,7 +109,7 @@
string
</div>
<div class="col-md-8 type">
<a href="#method_send">send</a>(int $type, string $nationCode, string $phoneNumbers, string $msg, string $extend = &quot;&quot;, string $ext = &quot;&quot;)
<a href="#method_send">send</a>(int $type, string $nationCode, array $phoneNumbers, string $msg, string $extend = &quot;&quot;, string $ext = &quot;&quot;)
<p>普通群发</p> </div>
<div class="col-md-2"></div>
@ -170,7 +170,7 @@
<h3 id="method_send">
<div class="location">at line 47</div>
<code> string
<strong>send</strong>(int $type, string $nationCode, string $phoneNumbers, string $msg, string $extend = &quot;&quot;, string $ext = &quot;&quot;)
<strong>send</strong>(int $type, string $nationCode, array $phoneNumbers, string $msg, string $extend = &quot;&quot;, string $ext = &quot;&quot;)
</code>
</h3>
<div class="details">
@ -195,7 +195,7 @@
<td>国家码,如 86 为中国</td>
</tr>
<tr>
<td>string</td>
<td>array</td>
<td>$phoneNumbers</td>
<td>不带国家码的手机号列表</td>
</tr>

@ -1 +1 @@
C:19:"Sami\Renderer\Index":931:{a:3:{i:0;a:10:{s:26:"Qcloud\Sms\FileVoiceSender";s:40:"6978e1650c392e9510bf514da5672b28050e95f7";s:32:"Qcloud\Sms\SmsMobileStatusPuller";s:40:"728a70f32eddaa9ce779996e17f2f972119b180d";s:25:"Qcloud\Sms\SmsMultiSender";s:40:"5d26b947eeb83e52b11dda40d71d2d61200ce024";s:24:"Qcloud\Sms\SmsSenderUtil";s:40:"caf29c3ee6375b8aaeb59f0a1bb1d8aca124ef47";s:26:"Qcloud\Sms\SmsSingleSender";s:40:"f814e68da128f2363023997f93bc081ec2fd166a";s:26:"Qcloud\Sms\SmsStatusPuller";s:40:"956c7c7432dbe6038e1713bfbc003c361c7a6bf0";s:31:"Qcloud\Sms\SmsVoicePromptSender";s:40:"9f3c118ec943dfcf418c8adc77cbb503f3d0d5b9";s:35:"Qcloud\Sms\SmsVoiceVerifyCodeSender";s:40:"842a013386d41859b7b0e26fb6532541d9c18c51";s:25:"Qcloud\Sms\TtsVoiceSender";s:40:"2450011b4197396ad9310c9c313fde11de00aa8e";s:28:"Qcloud\Sms\VoiceFileUploader";s:40:"af402449d620dc0b886a327fd81e062095efd3f2";}i:1;a:1:{i:0;s:6:"master";}i:2;a:2:{i:0;s:6:"Qcloud";i:1;s:10:"Qcloud\Sms";}}}
C:19:"Sami\Renderer\Index":931:{a:3:{i:0;a:10:{s:26:"Qcloud\Sms\FileVoiceSender";s:40:"40eda58f173e6c38986a12ca2f557399a0cfea90";s:32:"Qcloud\Sms\SmsMobileStatusPuller";s:40:"728a70f32eddaa9ce779996e17f2f972119b180d";s:25:"Qcloud\Sms\SmsMultiSender";s:40:"8d39c5c50a70a4b3a409a72edbcb0a5ebecc67cf";s:24:"Qcloud\Sms\SmsSenderUtil";s:40:"caf29c3ee6375b8aaeb59f0a1bb1d8aca124ef47";s:26:"Qcloud\Sms\SmsSingleSender";s:40:"f814e68da128f2363023997f93bc081ec2fd166a";s:26:"Qcloud\Sms\SmsStatusPuller";s:40:"956c7c7432dbe6038e1713bfbc003c361c7a6bf0";s:31:"Qcloud\Sms\SmsVoicePromptSender";s:40:"9f3c118ec943dfcf418c8adc77cbb503f3d0d5b9";s:35:"Qcloud\Sms\SmsVoiceVerifyCodeSender";s:40:"842a013386d41859b7b0e26fb6532541d9c18c51";s:25:"Qcloud\Sms\TtsVoiceSender";s:40:"cb11b8915b562bef67cf6034948046205b867f2b";s:28:"Qcloud\Sms\VoiceFileUploader";s:40:"1f9ed1316b1a53c880732bbee8efc7957ee16c2d";}i:1;a:1:{i:0;s:6:"master";}i:2;a:2:{i:0;s:6:"Qcloud";i:1;s:10:"Qcloud\Sms";}}}

@ -24,7 +24,7 @@ class FileVoiceSender
*/
public function __construct($appid, $appkey)
{
$this->url = "https://cloud-test.tim.qq.com/v5/tlsvoicesvr/sendfvoice";
$this->url = "https://cloud.tim.qq.com/v5/tlsvoicesvr/sendfvoice";
$this->appid = $appid;
$this->appkey = $appkey;
$this->util = new SmsSenderUtil();

@ -24,7 +24,7 @@ class TtsVoiceSender
*/
public function __construct($appid, $appkey)
{
$this->url = "https://cloud-test.tim.qq.com/v5/tlsvoicesvr/sendtvoice";
$this->url = "https://cloud.tim.qq.com/v5/tlsvoicesvr/sendtvoice";
$this->appid = $appid;
$this->appkey = $appkey;
$this->util = new SmsSenderUtil();

@ -27,7 +27,7 @@ class VoiceFileUploader
*/
public function __construct($appid, $appkey)
{
$this->url = "https://cloud-test.tim.qq.com/v5/tlsvoicesvr/uploadvoicefile";
$this->url = "https://cloud.tim.qq.com/v5/tlsvoicesvr/uploadvoicefile";
$this->appid = $appid;
$this->appkey = $appkey;
$this->util = new SmsSenderUtil();

Loading…
Cancel
Save