PHPackages                             symkit/mailer-bundle - 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. symkit/mailer-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

symkit/mailer-bundle
====================

Symfony bundle for managing and sending MJML templates with event-driven logging and asynchronous support.

v0.0.2(3mo ago)00MITPHPPHP &gt;=8.2CI failing

Since Feb 22Pushed 3mo agoCompare

[ Source](https://github.com/SymKit/mailer-bundle)[ Packagist](https://packagist.org/packages/symkit/mailer-bundle)[ RSS](/packages/symkit-mailer-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (18)Versions (3)Used By (0)

Symkit Mailer Bundle
====================

[](#symkit-mailer-bundle)

[![CI](https://github.com/symkit/mailer-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/symkit/mailer-bundle/actions)[![Latest Version](https://camo.githubusercontent.com/5f68c8eb8a55dfc89dd24860bf820eb1a0d0dc791646d2bb2dcebda3cccd758e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796d6b69742f6d61696c65722d62756e646c652e737667)](https://packagist.org/packages/symkit/mailer-bundle)[![PHPStan Level 9](https://camo.githubusercontent.com/1bc07920f0d36e55c17e1d38b1caa132cc605f51a82b388c962870b9a747b898/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e2e737667)](https://phpstan.org/)

A Symfony bundle to manage and send emails from MJML-based templates, with event-driven logging and optional asynchronous sending via Symfony Messenger.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Symfony 7.0+ or 8.0+
- [notfloran/mjml-bundle](https://github.com/NotFloran/mjml-bundle) (MJML rendering)
- [symkit/crud-bundle](https://github.com/symkit/crud-bundle) (admin UI)
- [symkit/form-bundle](https://github.com/symkit/form-bundle)

For asynchronous sending, install [symfony/messenger](https://symfony.com/doc/current/messenger.html) (see `composer suggest`).

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

[](#installation)

```
composer require symkit/mailer-bundle
```

Register the bundle in `config/bundles.php`:

```
return [
    // ...
    Symkit\MailerBundle\SymkitMailerBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

Create or edit `config/packages/symkit_mailer.yaml`:

```
symkit_mailer:
    doctrine: true       # Entities and repositories (disable if not using Doctrine)
    logging: true       # Log sends to EmailLog (requires doctrine)
    messenger: true     # Register Messenger handler for async sending (requires symfony/messenger)
    admin:
        enabled: true
        route_prefix: symkit_mailer_admin
    entity:
        email_class: Symkit\MailerBundle\Entity\Email
        email_repository_class: Symkit\MailerBundle\Repository\EmailRepository
        layout_class: Symkit\MailerBundle\Entity\Layout
        layout_repository_class: Symkit\MailerBundle\Repository\LayoutRepository
        email_log_class: Symkit\MailerBundle\Entity\EmailLog
        email_log_repository_class: Symkit\MailerBundle\Repository\EmailLogRepository
```

If you override entity or repository classes (e.g. with subclasses), ensure your Doctrine mapping (e.g. `targetEntity` on relations) stays consistent with those classes.

### Admin routes

[](#admin-routes)

Mount the bundle routes with a prefix (e.g. under `/admin/email`):

```
# config/routes.yaml
symkit_mailer_admin:
    resource: '@SymkitMailerBundle/config/routes.yaml'
    prefix: /admin/email
```

### MJML

[](#mjml)

Configure [notfloran/mjml-bundle](https://github.com/NotFloran/mjml-bundle) (e.g. `config/packages/mjml.yaml`) and set `MAILER_DSN` in your `.env` file.

Usage
-----

[](#usage)

### Synchronous sending

[](#synchronous-sending)

Inject `Symkit\MailerBundle\Contract\EmailSenderInterface` and call `send()` with the template slug, recipient, and Twig context:

```
$this->emailSender->send(
    'welcome',           // template slug (stored in DB)
    'user@example.com',  // recipient
    ['name' => 'John']   // Twig context
);
```

### Asynchronous sending (Messenger)

[](#asynchronous-sending-messenger)

When `symkit_mailer.messenger` is enabled and `symfony/messenger` is installed, dispatch a message:

```
$bus->dispatch(new SendEmailMessage('welcome', 'user@example.com', ['name' => 'John']));
```

Events
------

[](#events)

The bundle dispatches the following events (subscribe to them for custom logging or side effects):

EventWhenPayload (typical)`EmailSendingEvent`Send startedmessageId, recipient, subject`EmailSentEvent`Send succeededmessageId, HTML content`EmailFailedEvent`Send failedmessageId, error messageWhen `logging` is enabled, `EmailLogSubscriber` persists these to the `EmailLog` entity.

Development and quality
-----------------------

[](#development-and-quality)

From the bundle root:

```
make cs-fix     # Fix code style
make phpstan    # Static analysis (level 9)
make test       # PHPUnit
make deptrac    # Architecture layers
make quality    # Full pipeline (cs-check, phpstan, deptrac, test, infection)
make ci         # Security check + quality
```

License
-------

[](#license)

MIT.

###  Health Score

32

—

LowBetter than 70% of packages

Maintenance80

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

2

Last Release

107d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/077eba6702dc23a795ee2262dff92505e3c8ead08f7cb205be80d8aae0a6b8e5?d=identicon)[sdieunidou](/maintainers/sdieunidou)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/symkit-mailer-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/symkit-mailer-bundle/health.svg)](https://phpackages.com/packages/symkit-mailer-bundle)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M370](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M710](/packages/sylius-sylius)[kimai/kimai

Kimai - Time Tracking

4.7k8.7k1](/packages/kimai-kimai)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M444](/packages/pimcore-pimcore)

PHPackages © 2026

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