PHPackages                             pdapnz/yii2-sms-sigmasms - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. pdapnz/yii2-sms-sigmasms

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

pdapnz/yii2-sms-sigmasms
========================

A SigmaSMS plugin for Yii2 SMS, to make sending SMS messages as easy as emails!

1.0.2(2w ago)021MITPHPPHP &gt;=7.0.0

Since Apr 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/pdapnz/yii2-sms-sigmasms)[ Packagist](https://packagist.org/packages/pdapnz/yii2-sms-sigmasms)[ Docs](https://github.com/pdapnz/yii2-sms-sigmasms)[ RSS](/packages/pdapnz-yii2-sms-sigmasms/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Yii2 SigmaSMS
=============

[](#yii2-sigmasms)

A [SigmaSMS](https://sigmasms.ru/) plugin for Yii2 based extention [Yii2 SMS](https://github.com/wadeshuler/yii2-sms), to make sending SMS messages as easy as emails!

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/)

Either run

```
composer require --prefer-dist pdapnz/yii2-sms-sigmasms

```

or add

```
"pdapnz/yii2-sms-sigmasms": "~1.0"

```

to the require section of your application's `composer.json` file.

Then add a new `sms` component to your `main-local.php` (advanced) or `web.php` (basic) like so:

```
'sms' => [
    'class' => 'pdapnz\sms\sigmasms\Sms',

    // Advanced app use '@common/sms', basic use '@app/sms'
    'viewPath' => '@common/sms',     // Optional: defaults to '@app/sms'

    // send all sms to a file by default. You have to set
    // 'useFileTransport' to false and configure the messageConfig['from'],
    'useFileTransport' => true,

    'messageConfig' => [
        'from' => 'B-Media',  // Your SigmaSMS upproved sender name
    ],

    // You username and password at https://online.sigmasms.ru/
    'username' => 'yourUsername',
    'password' => 'yourPassword',

],

```

Usage
-----

[](#usage)

You can send SMS messages two ways. One uses a view file, just like how the mailer does, by passing it in the `compose()` call. Only difference is, you don't specify html/text array keys. Just pass the string, since text messages don't use html.

### With a view file

[](#with-a-view-file)

In your controller/model use it like so:

```
Yii::$app->sms->compose('test-message', ['name' => 'Wade'])
    //->setFrom('12345')  // if not set in config, or to override
    ->setTo('+15558881234')
    ->send();

```

You will need a view file located where your `viewPath` points to. By default, it is `@app/sms`. You can see in the configuration above that we overrode it to `@common/sms`. This is similar to the location Yii2 Advanced uses for the email views, the "common" directory.

View File: `common/sms/test-message.php` (advanced) or `/sms/test-message.php` (basic)

```
Hello  This is a test!

Thanks!

```

### Without a view file

[](#without-a-view-file)

When sending a large amount of text messages quickly, you may want to skip the view file for performance reasons, or you just may find it overkill for your usage.

```
$name = "Wade";

Yii::$app->sms->compose()
    //->setFrom('12345')  // optional if set in main config
    ->setTo('+15558881234')
    ->setMessage("Hey {$name} this is a test!")
    ->send();

```

`setMessage()` is a nicename function, or alias, for `setTextBody()`. Since SMS messages only deal with text and not html, I felt this was cleaner. However, `setTextBody()` will work just the same if your familiar with the way the mailer handles things. Either is fine.

Determining a successful send
-----------------------------

[](#determining-a-successful-send)

A boolean is returned, so it is simple:

```
$result = Yii::$app->sms->compose()
    ->setTo('+15558881234')
    ->setMessage("Hey {$name} this is a test!")
    ->send();

if ( $result === true ) {
    echo 'SMS was sent!';
} else {
    'Error sending SMS!';
}

```

Do I have to call `setFrom()`?
------------------------------

[](#do-i-have-to-call-setfrom)

You only have to use `setFrom()` if you did not specify a `from` number in the configuration, within the `messageConfig` array.

If you want to override the `from` address in your main configuration, then you can call `setFrom()` specifically.

If you only send from 1 number, just configure it and don't call it directly so you don't have to change it in a bunch of places later.

*Tip: If you have multuple numbers, use the Yii2 params array for an all-in-one easy spot to modify the numbers later.*

Where can I find error logs?
----------------------------

[](#where-can-i-find-error-logs)

When an Exception is hit during sending, they will be recorded under `@runtime/sms` and named according to the type of exception.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance53

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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 ~924 days

Total

3

Last Release

19d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23627398?v=4)[pdapnz](/maintainers/pdapnz)[@pdapnz](https://github.com/pdapnz)

---

Top Contributors

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

---

Tags

smsyii2text messageyii2 smssigamasmsyii2 sigamasms

### Embed Badge

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

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

###  Alternatives

[tuyakhov/yii2-notifications

The extension provides support for sending notifications across a variety of delivery channels, including mail, SMS, Slack etc. Notifications may also be stored in a database so they may be displayed in your web interface.

6735.5k2](/packages/tuyakhov-yii2-notifications)

PHPackages © 2026

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