PHPackages                             demmonico/yii2-sms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. demmonico/yii2-sms

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

demmonico/yii2-sms
==================

Yii2 extension which allow send sms using multiply providers. Now available Nexmo provider

v1.0.2(9y ago)0100MITPHPPHP &gt;5.5.0

Since Aug 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/demmonico/yii2-sms)[ Packagist](https://packagist.org/packages/demmonico/yii2-sms)[ Docs](https://github.com/demmonico/yii2-sms)[ RSS](/packages/demmonico-yii2-sms/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

\#Yii2 component - Sms Sender ##Description Yii2 component which allow simple send sms using multiply providers. Switching between providers supports using yii config file (better)

\##Configure ###Common params

```
return [
    //...
    'components' => [
        //...
        'sms' => [
            'class' => 'demmonico\sms\Sender',
            'senderNumber' => 'name' or 'number',
            'provider' => [
                'class' => 'demmonico\sms\Nexmo',
                'apiKey' => '***',
                'apiSecret' => '***',
            ],
        ],
    ],
];
```

or DI

```
$component = \Yii::createObject('demmonico\sms\Nexmo', [
    [
        'class' => 'demmonico\sms\Sender',
        'senderNumber' => 'name' or 'number',
        'provider' => [
            'class' => 'demmonico\sms\Nexmo',
            'apiKey' => '***',
            'apiSecret' => '***',
        ],
    ],
]);
```

or using config component's bootstrap method (see )

in config file

```
return [
    //...
    'components' => [
        //...
        'sms' => [
            'class' => 'demmonico\sms\Sender',
            'senderNumber' => 'name' or 'number',
            'provider' => [
                'class' => 'demmonico\sms\Nexmo',
                'apiKey' => [
                    'component' => 'config',
                    'sms.Nexmo.apiKey',
                ],
                'apiSecret' => [
                    'component' => 'config',
                    'sms.Nexmo.apiSecret',
                ],
            ],
        ],
    ],
];
```

and in local params file

```
return [
    //...
    'sms.Nexmo.apiKey' => '******',
    'sms.Nexmo.apiSecret' => '******',
];
```

Now available Nexmo provider only. But you can add any external class with your custom provider. New providers can be added by creating class, which will implements `demmonico\sms\SmsProviderInterface` and extends (optional) `demmonico\sms\BaseProvider`.

\###Debug params For debug you can use redirect option and dummy option. They can use separately or together. If redirect option `redirectNumber` is set then all messages will be send to this number. If dummy option `dummyNumbers` is set and field $to matches to any of dummyNumbers elements then process send will be skip and all sms fields will be logged

```
return [
    //...
    'components' => [
        //...
        'sms' => [
            //...
            'debug' => [
                'redirectNumber' => 'number',
                'dummyNumbers' => [
                    'number',
                    //...
                ],
            ],
        ],
    ],
];
```

\##Usage ###Send sms

```
Yii::$app->sms->sendSms('Hello, world!', 'number');
```

or

```
Yii::$app->sms->sendSms('Hello, world!', 'recipientNumber', 'senderNumber');
```

Numbers must be in [E.164](https://en.wikipedia.org/wiki/E.164) format. Method returns number (integer) of sent sms.

\###Get account balance

```
Yii::$app->sms->getBalance();
```

Method returns balance value (float).

\###Get account numbers

```
Yii::$app->sms->getNumbers();
```

Method returns array of numbers which are associate with account.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Total

3

Last Release

3510d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc04250a201bcb8f1e48f8d4551e4785a02e79f66f52449e70aa2435f2cdcba5?d=identicon)[demmonico](/maintainers/demmonico)

---

Top Contributors

[![demmonico](https://avatars.githubusercontent.com/u/10497315?v=4)](https://github.com/demmonico "demmonico (5 commits)")

---

Tags

smssendyii2extensionyiicomponentnexmo

### Embed Badge

![Health badge](/badges/demmonico-yii2-sms/health.svg)

```
[![Health](https://phpackages.com/badges/demmonico-yii2-sms/health.svg)](https://phpackages.com/packages/demmonico-yii2-sms)
```

###  Alternatives

[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.8k](/packages/umanskyi31-opengraph)[abhi1693/yii2-sms

Send Free Sms for Yii2

171.9k](/packages/abhi1693-yii2-sms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
