PHPackages                             matperez/yii2-sms-sender - 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. matperez/yii2-sms-sender

ActiveProject[Utility &amp; Helpers](/categories/utility)

matperez/yii2-sms-sender
========================

Yii2 SMS sender

1.3.0(9y ago)07.7k↓33.3%MITPHPPHP &gt;= 5.5.0

Since Sep 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/matperez/yii2-sms-sender)[ Packagist](https://packagist.org/packages/matperez/yii2-sms-sender)[ RSS](/packages/matperez-yii2-sms-sender/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (12)Used By (0)

yii2-sms-sender
===============

[](#yii2-sms-sender)

[![Build Status](https://camo.githubusercontent.com/b5be4b6390db31eb3c6f658f1fc665768148da10fb2f3e2127b5901e3c7541fb/68747470733a2f2f7472617669732d63692e6f72672f6d6174706572657a2f796969322d736d732d73656e6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/matperez/yii2-sms-sender)[![Coverage Status](https://camo.githubusercontent.com/9409ca36320fbfc8ef6dd927729352d9c3e7d6206826ba07b1452f98e3e70d99/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6174706572657a2f796969322d736d732d73656e6465722f62616467652e737667)](https://coveralls.io/github/matperez/yii2-sms-sender)

Yii2 SMS Sender

Setup
-----

[](#setup)

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

Either run

```
php composer.phar require --prefer-dist matperez/yii2-sms-sender

```

or add

```
"matperez/yii2-sms-sender": "*"

```

to the require section of your `composer.json` file.

### Dev environment

[](#dev-environment)

```
'components' = [
  'sms' => [
    'viewPath' => '@app/sms',
    'class' => \matperez\yii2smssender\components\Sender::class,
    'transportConfig' => [
      'class' => \matperez\yii2smssender\transports\FileTransport::class,
    ],
  ],
],

```

### Production environment

[](#production-environment)

Using

```
'components' = [
  'sms' => [
    'viewPath' => '@app/sms',
    'class' => \matperez\yii2smssender\components\Sender::class,
    'transportConfig' => [
      'class' => \matperez\yii2smssender\transports\IntegrationApiTransport::class,
      'login' => 'login',
      'password' => 'password',
    ],
  ],
],

```

Place this somewhere in a bootstrap file

```
\Yii::$container->set(\GuzzleHttp\ClientInterface::class, function() {
  return new \GuzzleHttp\Client();
});

```

### Usage

[](#usage)

#### Composing a message

[](#composing-a-message)

The message can be composed from a template. The template name could be relative to `viewPath` or it could be a full path to a the view. Yii aliases are acceptable.

```
$message = Yii::$app->sms->compose('template_name', $params);
$message = Yii::$app->sms->compose('@app/sms/template_name', $params);

```

It is also possible to compose an empty message when no view name provided

```
$message = Yii::$app->sms->compose();

```

#### Middleware

[](#middleware)

The message can be preprocessed prior to sending. For example log or modify its content. Middleware should be set as an array of callable.

```
'components' = [
  'sms' => [
      'class' => \matperez\yii2smssender\components\Sender::class,
      'middleware' => [
          function(\matperez\yii2smssender\interfaces\IMessage $message) {
              $message->setMessage('new message content');
          }
      ]
  ],
],

```

#### Sending a message

[](#sending-a-message)

```
$message = Yii::$app->sms->compose('some-view', $params);
$message->setTo('1234345456');
$message->setFrom('sender');
$message->send();

```

#### Balance checking

[](#balance-checking)

```
if (Yii::$app->sms->canFetchBalance()) {
  $balance = Yii::$app->sms->getBalance();
}

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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

Recently: every ~0 days

Total

11

Last Release

3384d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b2fde2b42281c600f7dd9ee316a323b141294178c65ec60d949d7010ede1fe6?d=identicon)[matperez](/maintainers/matperez)

---

Top Contributors

[![matperez](https://avatars.githubusercontent.com/u/1917115?v=4)](https://github.com/matperez "matperez (1 commits)")

---

Tags

smsyii2

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[daixianceng/yii2-smser

Yii2 SMS extension

862.9k1](/packages/daixianceng-yii2-smser)[saviorlv/yii2-dysms

Aliyun SMS SDK for Yii2

1316.5k1](/packages/saviorlv-yii2-dysms)[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)
