luciuz/sms-ru

Sending sms via sms.ru

1.0.3 2018-04-27 10:45 UTC

This package is auto-updated.

Last update: 2024-05-24 04:37:50 UTC


README

Sending sms via sms.ru

Examples

Init

$smsRu = new SmsRu('API-ID-TOKEN');

Sending single sms

// with From
$result = $smsRu->setFrom('MYCOMPANY')
    ->send(new Sms('+79123456789', 'Some text'));
    
// without From
$result = $smsRu->send(new Sms('+79123456789', 'Some text'));

Sending multiple sms

$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);