PHPackages                             adt/mail-queue - 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. adt/mail-queue

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

adt/mail-queue
==============

The ultimate Nette mailing solution.

v1.8(1y ago)310.9k↓40%3MITPHPPHP ^7.1|^8.0

Since Sep 27Pushed 1y ago13 watchersCompare

[ Source](https://github.com/AppsDevTeam/MailQueue)[ Packagist](https://packagist.org/packages/adt/mail-queue)[ RSS](/packages/adt-mail-queue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (38)Used By (0)

MailQueue
=========

[](#mailqueue)

Allows in-app mail queueing and delayed sending.

1.1 Installation
----------------

[](#11-installation)

composer:

```
composer require adt/mail-queue
```

config.neon:

```
extensions:
	adtMailQueue: ADT\MailQueue\DI\MailQueueExtension
```

### 1.1.1 Using default Queue entity

[](#111-using-default-queue-entity)

Let Doctrine know about our entity:

```
doctrine:
	metadata:
		ADT\MailQueue\Entity: %vendorDir%/adt/mail-queue/src/Entity
```

### 1.1.2 Using custom Queue entity

[](#112-using-custom-queue-entity)

Create your own entity that extends our abstract entity:

```
namespace App\Model\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class QueueEntity extends \ADT\MailQueue\Entity\AbstractMailQueueEntry {

	/**
	 * @ORM\Column(type="text")
	 */
	protected $customProperty;

}
```

Let us know about your custom entity:

```
adtMailQueue:
	queueEntityClass: App\Model\Entity\QueueEntity
```

To fill custom properties of your entity when enqueueing mail, you can use second argument of `enqueue`:

```
$this->mailQueueService->enqueue($mail, [
	'customProperty' => 'customValue'
]);
```

or

```
$this->mailQueueService->enqueue($mail, function (QueueEntity $e) {
	$e->customProperty = 'customValue';
});
```

---

### 1.2.1 Using one and only `IMailer`

[](#121-using-one-and-only-imailer)

```
adtMailQueue:
	mailer: @sparkPostApiMailerService
```

### 1.2.2 Custom mailer

[](#122-custom-mailer)

If you need to decide which mailer you want to use based on information in your custom Queue entity, you can implement `ADT\MailQueue\Service\IMessenger`interface. This interface has `send($entity)` method where `$entity` is your custom entity.

```
adtMailQueue:
	messenger: @queueMailerMessenger
```

---

### 1.3 Migration

[](#13-migration)

Clear your `temp/cache` directory.

Generate migration and migrate:

```
php www/index.php migrations:diff
php www/index.php migrations:migrate
```

### 1.4 Processing enqueued messages

[](#14-processing-enqueued-messages)

Use predefined console command:

```
php www/index.php mail-queue:process
```

or get `ADT\MailQueue\Services\QueueService` from DI container and call:

```
$queueService->process()
```

### 1.5 Send error handler

[](#15-send-error-handler)

If you need to handle send error, you can set:

```
adtMailQueue:
	sendErrorHandler: @ErrorHandlerClass::handlerMethod
```

Handler method receives queue entry entity and exception generated on send.

### 1.6 Queue drained event

[](#16-queue-drained-event)

If you need notification when queue is drained, you can set:

```
adtMailQueue:
	onQueueDrained: @EventHandlerClass::handlerMethod
```

Event handler receives instance of `OutputInterface` if available, `NULL` otherwise.

2.1 Configuration
-----------------

[](#21-configuration)

```
adtMailQueue:
    messenger: #or mailer
    queueEntityClass: #default Entity\MailQueueEntry::class,
    autowireMailer: false
    sendErrorHandler: null
    onQueueDrained: null
    lockTimeout: 600
    limit: 1000 #how many emails send
    tempDir: %tempDir%
    backgroundQueueService: @ADT\BackgroundQueue\Service
    backgroundQueueCallbackName: mailSending
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~170 days

Total

31

Last Release

713d ago

PHP version history (2 changes)v1.6PHP ^7.1

v1.6.3PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5575ff5b286a1982356d8ed7d8fc9f44385b44ef1108f34ac8c71b106d0c69ec?d=identicon)[michallohnisky](/maintainers/michallohnisky)

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

---

Top Contributors

[![thorewi](https://avatars.githubusercontent.com/u/605858?v=4)](https://github.com/thorewi "thorewi (13 commits)")[![masicek](https://avatars.githubusercontent.com/u/1160736?v=4)](https://github.com/masicek "masicek (5 commits)")[![michallohnisky](https://avatars.githubusercontent.com/u/4747059?v=4)](https://github.com/michallohnisky "michallohnisky (4 commits)")[![NoxZet](https://avatars.githubusercontent.com/u/23127344?v=4)](https://github.com/NoxZet "NoxZet (4 commits)")[![Ivorius](https://avatars.githubusercontent.com/u/552101?v=4)](https://github.com/Ivorius "Ivorius (3 commits)")[![tkorcina](https://avatars.githubusercontent.com/u/31270983?v=4)](https://github.com/tkorcina "tkorcina (1 commits)")[![Danoha](https://avatars.githubusercontent.com/u/6437793?v=4)](https://github.com/Danoha "Danoha (1 commits)")

### Embed Badge

![Health badge](/badges/adt-mail-queue/health.svg)

```
[![Health](https://phpackages.com/badges/adt-mail-queue/health.svg)](https://phpackages.com/packages/adt-mail-queue)
```

###  Alternatives

[contributte/mailing

Sending emails with pleasure and prepared templates.

16961.0k2](/packages/contributte-mailing)[dotblue/mandrill

OO wrapper above Mandrill API for sending e-mails

1476.5k1](/packages/dotblue-mandrill)

PHPackages © 2026

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