PHP bindings for QuickTelecom SMS gateway
composer require bankiru/qtelecom-sms
<?php
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'));
Register bundle to the kernel
class AppKernel extends Kernel {
public function registerBundles() {
return [
//...
new \ScayTrase\SmsDeliveryBundle\SmsDeliveryBundle();
new \Bankiru\Sms\QtSms\QtSmsBundle(),
//...
];
}
}
Configure the sender
sms_delivery:
transport: qt_sms.transport
qt_sms:
login: user
password: pass
url: https://service.qtelecom.ru/public/http/
sender: friendly_man
Send SMS
class MyController extends Controller {
public function sendAction() {
$this->get('sms_delivery.sender')->spoolMessage(new MySms('1234567890', 'message body'));
}
}