alexeevdv/yii2-sms

This extension allows SMS sending via different SMS providers

Installs: 6 690

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

1.0.1 2020-06-01 05:46 UTC

This package is auto-updated.

Last update: 2021-12-29 02:53:22 UTC


README

Build Status codecov PHP 5.6 PHP 7.0 PHP 7.1 PHP 7.2 PHP 7.3 PHP 7.4

This extension allows SMS sending via different SMS providers

Installation:

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist alexeevdv/yii2-sms "~1.0"

or add

"alexeevdv/yii2-sms": "~1.0"

to the require section of your composer.json.

Configuration:

use alexeevdv\sms\provider\SmsRuProvider;
use alexeevdv\sms\Sms;

//...
   'components' => [
       'sms' => [
           'class' => Sms::class,
           'provider' => [
               'class' => SmsRuProvider::class,
               'apiId' => '123456789',
           ],
       ],
   ],
//...

Usage:


$result = Yii::$app->sms->send('1234567890', 'Hi there!');

Supported providers:

  • sms.ru

    Class: \alexeevdv\sms\provider\SmsRuProvider Params:

    • apiId - Your api ID from sms.ru
  • smsc.ru

    Class: \alexeevdv\sms\provider\SmscRuProvider Params:

    • login - Your login from smsc.ru
    • psw - Your plain text or MD5 hashed password from smsc.ru