avtonom / sms-streamtelecom-bundle
Provider to send SMS notifications for Symfony2 bundle for PHP
Installs: 775
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- avtonom/sms-sender-bundle: ~1.4
- symfony/dependency-injection: ~2.3|3.*
- symfony/monolog-bundle: 2.*
This package is not auto-updated.
Last update: 2024-11-11 19:55:58 UTC
README
Provider to send SMS notifications for Symfony2 bundle for PHP by Stream Telecom (stream-telecom.ru). Use KPhoenSmsSenderBundle for Symfony and Carpe-Hora/SmsSender.
Page bundle: https://github.com/Avtonom/sms-streamtelecom-bundle
Features
- Get the session ID (receiving the token, authorization)
- Sending a single SMS message (without taking into account the recipient's time zone)
- Getting user balance
- Validation of input data through a standard functional forms.
Maybe in the future:
- Security (blocking) from overly frequent messaging.
HttpAdapters
HttpAdapters are responsible to get data from remote APIs.
Currently, there are the following adapters:
CurlHttpAdapter
for cURL; (recommended)BuzzHttpAdapter
for Buzz, a lightweight PHP 5.3 library for issuing HTTP requests; (For additional installation of this dependence)
To Install
Run the following in your project root, assuming you have composer set up for your project
composer.phar require avtonom/sms-streamtelecom-bundle ~1.1
Switching ~1.1
for the most recent tag.
Add the bundle to app/AppKernel.php
$bundles( ... new KPhoen\SmsSenderBundle\KPhoenSmsSenderBundle(), new Avtonom\Sms\StreamtelecomBundle\AvtonomSmsStreamtelecomBundle(), ... );
Configuration options (config.yaml):
k_phoen_sms_sender: pool: ~ # right now, only "memory" is supported providers: [streamtelecom] factories: [ "%kernel.root_dir%/../vendor/avtonom/sms-streamtelecom-bundle/Avtonom/Sms/StreamtelecomBundle/Resources/config/provider_factories.xml" ] streamtelecom: login: %sms.provider.streamtelecom.login% password: %sms.provider.streamtelecom.password% originators: %sms.provider.streamtelecom.originators%
Configuration options (parameters.yaml):
parameters: sms.provider.streamtelecom.login: ~ sms.provider.streamtelecom.password: ~ sms.provider.streamtelecom.originators: [] # Leave an empty array if there is no strict checking the sender's name
Create a logger named "avtonom_sms.logger". Sample code (services.yml):
services: avtonom_sms.logger: public: true class: Symfony\Bridge\Monolog\Logger arguments: [sms]
Use
try { $sendResult = $this->get('sms.sender')->send('0642424242', 'It\'s the answer.', 'Kévin'); } catch(\SmsSender\Exception\WrappedException $e){ if($e->getWrappedException() && $e->getWrappedException() instanceof \SmsSender\Exception\AdapterException){ $smsException = new \Exception($e->getWrappedException()->getMessage(), $e->getWrappedException()->getCode(), $e); if($e->getWrappedException()->getData()){ var_dump($e->getWrappedException()->getData()); // request data } } throw $smsException; }
Need Help?
- Create an issue if you've found a bug,