bankiru / qtelecom-sms
Bindings for QuickTelecom SMS gateway
Installs: 29 171
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ~5.6 || ~7.0
- scaytrase/symfony-sms-delivery-bundle: ~2.1
Requires (Dev)
- phpunit/phpunit: ~5.1
This package is not auto-updated.
Last update: 2022-11-08 04:53:21 UTC
README
PHP bindings for QuickTelecom SMS gateway
Installation
composer require bankiru/qtelecom-sms
Usage
Standalone
<?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'));
Symfony
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')); } }