PHPackages                             yiicod/yii2-mailqueue - 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. yiicod/yii2-mailqueue

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

yiicod/yii2-mailqueue
=====================

The simple and powerful Mail Queue for the Yii2 framework

1.1.1(8y ago)61.1k[1 issues](https://github.com/yiicod/yii2-mailqueue/issues)MITPHP

Since Jul 26Pushed 8y ago3 watchersCompare

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

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

Yii Mail Queue
==============

[](#yii-mail-queue)

[![Latest Stable Version](https://camo.githubusercontent.com/1c0d84a34692ac3ca64b444a7f032eaedc276e7cb5ce7f68122bf7acdd36e807/68747470733a2f2f706f7365722e707567782e6f72672f796969636f642f796969322d6d61696c71756575652f762f737461626c65)](https://packagist.org/packages/yiicod/yii2-mailqueue) [![Total Downloads](https://camo.githubusercontent.com/2cf68b1f96b07d3d4ee1cc4269eec95ce4c9414d72926534811a100151fd0924/68747470733a2f2f706f7365722e707567782e6f72672f796969636f642f796969322d6d61696c71756575652f646f776e6c6f616473)](https://packagist.org/packages/yiicod/yii2-mailqueue) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b28337f4e3665c2090c71d00f106b9089c02a066c999638339bcd937aaac6468/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f796969636f642f796969322d6d61696c71756575652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yiicod/yii2-mailqueue/?branch=master)[![Code Climate](https://camo.githubusercontent.com/cae7335d3dbab41d83d84323b47aaa5e198009f1d2fd37ae02200bbc8a7678a2/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f796969636f642f796969322d6d61696c71756575652f6261646765732f6770612e737667)](https://codeclimate.com/github/yiicod/yii2-mailqueue)

Mail queue for emails. You don't need think how many emails will be send, because when you install this extension you can setting this. You will have table, where you can see emails status.

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

Either run

```
php composer.phar require --prefer-dist yiicod/yii2-mailqueue "*"

```

or add

```
"yiicod/yii2-mailqueue": "*"
```

to the require section of your composer.json.

run

```
php yii migrate/up --migrationPath=@vendor/yiicod/yii2-mailqueue/migrations
```

Please note that messages are wrapped with `Yii::t()` to support message translations, you should define default message source for them if you don't use i18n.

```
'i18n' => [
    'translations' => [
        '*' => [
            'class' => 'yii\i18n\PhpMessageSource'
        ],
    ],
],
```

#### Config

[](#config)

Use pm2() as daemons manager.

```
'components' => [
    'mailqueue' => [
        'class' => 'yiicod\mailqueue\WorkerCommand',
    ],
]
...
'bootstrap' => array('mailqueue')
```

Full config you can find in the yiicod\\mailqueue\\config.

#### Console command

[](#console-command)

```
'commandMap' => [
    'mail-queue' => [
        'class' => 'yiicod\mailqueue\commands\MailQueueCommand',
    ],
],
```

##### OR use pm2(). This variant more preferable.

[](#or-use-pm2httppm2keymetricsio-this-variant-more-preferable)

```
'commandMap' => [
    'mail-queue' => [
        'class' => 'yiicod\mailqueue\commands\WorkerCommand',
    ],
],
```

###### pm2 config:

[](#pm2-config)

```
    {
      "apps": [
        {
          "name": "job-queue",
          "script": "yii",
          "args": [
            "mailqueue/work"
          ],
          "exec_interpreter": "php",
          "exec_mode": "fork_mode",
          "max_memory_restart": "1G",
          "watch": false,
          "merge_logs": true,
          "out_file": "runtime/logs/job_queue.log",
          "error_file": "runtime/logs/job_queue.log"
        }
      ]
    }
```

###### Run PM2 daemons

[](#run-pm2-daemons)

```
pm2 start daemons-app.json
```

#### Migration usage

[](#migration-usage)

Migration command or use manual() for configuration:

```
   yii migrate --migrationPath=@yiicod/mailqueue/migrations
```

#### Push in queue

[](#push-in-queue)

```
/**
 * Add mail from queue
 * @param string $to Email to
 * @param string $subject Email subject
 * @param string $body email, html
 * @param string|Array $from From email
 * @param string $attachs Attach for email array('path' => 'file path', 'name' => 'file bname')
 * @param Array $additionalFields Any additional fields
 */
Yii::app()->mailQueue->push($to, $subject, $body, $from = '', array $attachs = [], $additionalFields = []);
```

or

```
/**
 * Push mass
 * array(
 *    array(
 *      'field name to' => '',
 *      'field name subject' => '',
 *      'field name body' => '',
 *      'field name priority' => '',
 *      'field name from' => '',
 *      'field name attachs' => '',
 *    )
 * )
 * @param Array $data
 * @return int Return int
 */
Yii::app()->mailQueue->pushMass($data)
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 85% 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 ~187 days

Recently: every ~209 days

Total

6

Last Release

3011d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7934283ca98b7f31bb5bf13119a8495cad80ac9097125a48792f47caddb588b9?d=identicon)[lexxorlov](/maintainers/lexxorlov)

---

Top Contributors

[![lexxorlov](https://avatars.githubusercontent.com/u/7910574?v=4)](https://github.com/lexxorlov "lexxorlov (17 commits)")[![ArtemKostyukov](https://avatars.githubusercontent.com/u/10050434?v=4)](https://github.com/ArtemKostyukov "ArtemKostyukov (3 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/yiicod-yii2-mailqueue/health.svg)

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

###  Alternatives

[loveorigami/yii2-notification-wrapper

This module for renders a message from session flash (with ajax, pjax support and etc.)

77199.7k5](/packages/loveorigami-yii2-notification-wrapper)[nterms/yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer.

87129.2k2](/packages/nterms-yii2-mailqueue)[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)
