luciuz / sms-ru
通过sms.ru发送短信
1.0.3
2018-04-27 10:45 UTC
Requires
- php: ^7.0
- guzzlehttp/guzzle: ~6.0
This package is auto-updated.
Last update: 2024-09-24 05:34:43 UTC
README
通过sms.ru发送短信
示例
初始化
$smsRu = new SmsRu('API-ID-TOKEN');
发送单个短信
// with From $result = $smsRu->setFrom('MYCOMPANY') ->send(new Sms('+79123456789', 'Some text')); // without From $result = $smsRu->send(new Sms('+79123456789', 'Some text'));
发送多个短信
$smsBundle = [ new Sms('+79123456789', 'Some text'), new Sms('+79123456790', 'Some message'), new Sms('+79123456791', 'Some notification') ];
// with From $result = $smsRu->setFrom('MYCOMPANY') ->sendMulti($smsBundle); // without From $result = $smsRu->sendMulti($smsBundle);