PHP code example of bankiru / qtelecom-sms

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

    

bankiru / qtelecom-sms example snippets




use Bankiru\Sms\QtSms\QtSms;
use Bankiru\Sms\QtSms\QtSmsTransport;
use ScayTrase\SmsDeliveryBundle\Service\ShortMessageInterface;

class MySms implements  ShortMessageInterface {
    /* ... */
}

$transport = new QtSmsTransport(
    new QtSms('user', 'pass', 'https://service.qtelecom.ru/public/http/'),
    'friendly_man'
);
$transport->send(new MySms('1234567890', 'message body'));

class AppKernel extends Kernel {
    public function registerBundles() {
        return [
            //...
            new \ScayTrase\SmsDeliveryBundle\SmsDeliveryBundle();
            new \Bankiru\Sms\QtSms\QtSmsBundle(),
            //...
        ];
    }
}

class MyController extends Controller {
    public function sendAction() {
        $this->get('sms_delivery.sender')->spoolMessage(new MySms('1234567890', 'message body'));
    }
}