diff --git a/README.md b/README.md index 4bda9e3..c416a29 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,38 @@ -# smsapi-bundle +# kch/smsapi-bundle +Symfony 2 Bundle for SMSApi PHP Client library. + Symfony 2 Bundle dla biblioteki SMSApi PHP Client. + +## Installation: +`composer require kch/smsapi-bundle` + +## Configuration - config.yml: +``` +kch_sms_api: + clients: + default: + client_login: TEST + client_password_hash: TEST +``` + +## Usage - sending one SMS: +Based on original library code: [https://github.com/smsapi/smsapi-php-client/wiki/Examples](https://github.com/smsapi/smsapi-php-client/wiki/Examples) +``` +$smsFactory = $this->get('kch_sms_api.sms_factory.default'); + +try { + $actionSend = $smsFactory->actionSend(); + + $actionSend->setTo('600xxxxxx'); + $actionSend->setText('Hello World!!'); + $actionSend->setSender('Info'); //Pole nadawcy, lub typ wiadomoĊ›ci: 'ECO', '2Way' + + $response = $actionSend->execute(); + + foreach ($response->getList() as $status) { + echo $status->getNumber() . ' ' . $status->getPoints() . ' ' . $status->getStatus(); + } +} catch (SmsapiException $exception) { + echo 'ERROR: ' . $exception->getMessage(); +} +``` \ No newline at end of file diff --git a/composer.json b/composer.json index 325e0be..78ea5cb 100644 --- a/composer.json +++ b/composer.json @@ -3,12 +3,12 @@ "description" : "Symfony 2 Bundle for SMSApi PHP Client library.", "type" : "symfony-bundle", "authors" : [{ - "name" : "", - "email" : "" + "name" : "KredytyChwilowkiProgrammer", + "email" : "p.pikula@kredyty-chwilowki.pl" }], "keywords" : ["sms", "mms", "vms", "bundle"], "license" : [ - "" + "MIT" ], "require" : { "php": ">=5.3.0",