toplan / phpsms

:iphone::rocket:Probably the most intelligent, elegant sms send library in php
MIT License
641 stars 129 forks source link

同一个短信服务商多个apikey如何更好的切换? #112

Closed CaesarChan closed 7 years ago

CaesarChan commented 7 years ago

由于审核原因,云片网的营销短信需要申请营销账号,因此会有两个apikey. 通过账号类型动态设置apikey没什么问题,但是有更好的解决方案么? 我自定义了YunPianAgent,想在Agent这边完成apikey的切换. 如果使用SMSManager,传递到Agent的业务数据已经被框架限制了. ` public function sendSms($to, $content, $tempId, array $data) { $this->sendContentSms($to, $content); }

public function sendContentSms($to, $content)`

由于短信接口被调用的地方比较多,封装到Agent的话,只需要 正常使用SMSManager就可以了.