2017 © Pedro Peláez
 

yii2-extension yii2-rocketsms

Yii2 component for SMS provider RocketSMS.by

image

ozerich/yii2-rocketsms

Yii2 component for SMS provider RocketSMS.by

  • Saturday, May 19, 2018
  • by Ozerich
  • Repository
  • 1 Watchers
  • 3 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 88 % Grown

The README.md

yii2-rocketsms

Yii2 component for SMS provider RocketSMS.by, (*1)

Installation

  1. The preferred way to install this extension is through composer., (*2)

    Either run, (*3)

    php composer.phar require ozerich/yii2-rocketsms "*"
    

    or add, (*4)

    "ozerich/yii2-rocketsms": "*"
    

    to the require section of your composer.json file., (*5)

  2. Add component configuration to your config.php, (*6)

    'components' => [
        'sms' => [
            'class' => 'blakit\rocketsms\RocketSms',
            'login' => 'your_login',
            'password' => 'your_password'
        ]
    ]

Usage

Send SMS:, (*7)

try {
    $response = \Yii::$app->sms->send('+375296000000', 'Test Message');
    echo 'SMS sent, message ID is ' . $response->getMessageId();
} catch (ErrorResponseException $exception) {
    echo 'Error sending SMS: ' . $exception->getError();
} catch (InvalidCredentialsException $exception) {
    echo 'RocketSMS credentials are invalid';
}

Check Balance:, (*8)

try {
    $response = \Yii::$app->sms->balance();
    echo 'Your balance: ' . $response->getBalance() . 'BYN, ' . $response->getCredits() . ' SMS';
} catch (InvalidCredentialsException $exception) {
    echo 'RocketSMS credentials are invalid';
}

Get message status:, (*9)

try {
    $response = \Yii::$app->sms->status('MESSAGE_ID');
    echo 'Message status: ' . $response->getStatus();
} catch (ErrorResponseException $exception) {
    echo 'Message not found';
} catch (InvalidCredentialsException $exception) {
    echo 'RocketSMS credentials are invalid';
}

The Versions

19/05 2018

dev-master

9999999-dev https://github.com/ozerich/yii2-rocketsms

Yii2 component for SMS provider RocketSMS.by

  Sources   Download

MIT

The Requires

 

extension yii2 sms rocketsms

19/05 2018

1.0.1

1.0.1.0 https://github.com/ozerich/yii2-rocketsms

Yii2 component for SMS provider RocketSMS.by

  Sources   Download

MIT

The Requires

 

extension yii2 sms rocketsms

19/05 2018

1.0

1.0.0.0 https://github.com/ozerich/yii2-rocketsms

Yii2 component for SMS provider RocketSMS.by

  Sources   Download

MIT

The Requires

 

extension yii2 sms rocketsms