PHPackages                             tigrov/yii2-email-reply - 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. tigrov/yii2-email-reply

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

tigrov/yii2-email-reply
=======================

Email Reply for Yii2 - passes reply messages to predefined objects.

1.0.4(6y ago)08MITPHP

Since Jul 15Pushed 6y agoCompare

[ Source](https://github.com/Tigrov/yii2-email-reply)[ Packagist](https://packagist.org/packages/tigrov/yii2-email-reply)[ RSS](/packages/tigrov-yii2-email-reply/feed)WikiDiscussions master Synced 2d ago

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

Email Reply for Yii2
====================

[](#email-reply-for-yii2)

It provides help to configure Yii2 to work with [Tigrov/email-reply](https://github.com/Tigrov/email-reply).

[Tigrov/email-reply](https://github.com/Tigrov/email-reply) library passes reply messages from email to predefined objects. It uses IMAP to connect email servers.

[![Latest Stable Version](https://camo.githubusercontent.com/aa2fac64fcf64a32ec06c27d4699694934215827c690115509ee501e63f6b09c/68747470733a2f2f706f7365722e707567782e6f72672f546967726f762f796969322d656d61696c2d7265706c792f762f737461626c65)](https://packagist.org/packages/Tigrov/yii2-email-reply)[![Build Status](https://camo.githubusercontent.com/c0965f1ecd0e503a1beac3145331381b1e612eae48172088c40f63e547616365/68747470733a2f2f7472617669732d63692e6f72672f546967726f762f656d61696c2d7265706c792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Tigrov/email-reply)

Limitation
----------

[](#limitation)

The library uses [ddeboer/imap](https://github.com/ddeboer/imap) and it requires:

- PHP &gt;= 7.1
- extensions `iconv`, `IMAP`, `mbstring`

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist tigrov/yii2-email-reply

```

or add

```
"tigrov/yii2-email-reply": "~1.0"

```

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

Usage
-----

[](#usage)

Firstly read [Tigrov/email-reply/README](https://github.com/Tigrov/email-reply/blob/master/README.md).

Then you can take steps:

1. Create an ActiveRecord model class with `ModelInterface` interface and implement `emailReply` method (see [examples/Model.php](https://github.com/Tigrov/email-reply/blob/master/examples/Model.php#L53)).

    ```
    class Model extends yii\db\ActiveRecord implements tigrov\emailReply\ModelInterface
    {
        use tigrov\yii2\emailReply\ActiveRecordThread;

        public function emailReply($message)
        {
            /** @var string $fromEmail email address of the sender */
            $fromEmail = $message->getFrom()->getAddress();

            /** @var string $fromName name of the sender */
            $fromName = $message->getFrom()->getName();

            /** @var string $content content from the replied message */
            $content = $message->getBodyHtml() ?: $message->getBodyText() ?: $message->getDecodedContent();

            // Parse the content to get only answer
            $content = EmailReplyParser::parseReply($content);

            // To do something with $content
            // e.g. add comment from $fromEmail to the object
        }
    }
    ```
2. Add `EmailReply` to Yii2 config file.

    ```
    return [
        ...
        'emailReply' => [
            'class' => 'tigrov\emailReply\EmailReply',
            'classesMap' => [
                // key will be used as prefix for email address
                'm' => \Model::class,
            ],
        ],
        ...
    ];
    ```
3. Send an email message with the special reply email address.

    ```
    $replyEmail = \Yii::$app->emailReply->getReplyEmail($model);

    // Send an email to somebody using the reply email address
    $message = \Yii::$app->mailer->compose($view)
        ->setReplyTo([$replyEmail => \Yii::$app->name])
        ->setFrom([$replyEmail => \Yii::$app->name]);

    // Set message subject, body, recipients and etc
    ...

    $message->send();
    ```
4. Create the console controller.

    ```
    class EmailReplyController extends tigrov\yii2\emailReply\EmailReplyController
    {
    }
    ```
5. Read your mailboxes using console command `yii email-reply`. For example as a `cron` job:

    `15 * * * * yii email-reply`
6. Each message will be passed to `Model::emailReply($message)` where you can precess them.

See [examples](https://github.com/tigrov/email-repl/examples) directory for examples.

Suggests
--------

[](#suggests)

You can use [willdurand/email-reply-parser](https://github.com/willdurand/EmailReplyParser) to parse only reply text from email messages.

```
$reply = EmailReplyParser::parseReply($content);
```

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

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

Total

5

Last Release

2493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/77d285672dec831b7ce5746ab8bb1dd20fffe81fb9d11c232534686706de9697?d=identicon)[Tigros](/maintainers/Tigros)

---

Top Contributors

[![Tigrov](https://avatars.githubusercontent.com/u/8563175?v=4)](https://github.com/Tigrov "Tigrov (6 commits)")

---

Tags

emailyii2reply

### Embed Badge

![Health badge](/badges/tigrov-yii2-email-reply/health.svg)

```
[![Health](https://phpackages.com/badges/tigrov-yii2-email-reply/health.svg)](https://phpackages.com/packages/tigrov-yii2-email-reply)
```

###  Alternatives

[nterms/yii2-mailqueue

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

87129.2k2](/packages/nterms-yii2-mailqueue)[nickcv/yii2-mandrill

Mandrill Api Integration for Yii2

29554.2k2](/packages/nickcv-yii2-mandrill)[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)[yarcode/yii2-mailgun-mailer

Mailgun mailer implementation for Yii2

1576.0k](/packages/yarcode-yii2-mailgun-mailer)[rmrevin/yii2-postman

Mail module for Yii2.

2612.3k](/packages/rmrevin-yii2-postman)

PHPackages © 2026

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