PHP code example of luciuz / sms-ru

1. Go to this page and download the library: Download luciuz/sms-ru 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/ */

    

luciuz / sms-ru example snippets


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