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

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

jacquesndl/mailer-bundle
========================

Jacquesndl/MailerBundle

1.0.2(5y ago)060MITPHPPHP &gt;=7.2

Since May 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jacquesndl/MailerBundle)[ Packagist](https://packagist.org/packages/jacquesndl/mailer-bundle)[ Docs](https://github.com/jacquesndl/MailerBundle)[ RSS](/packages/jacquesndl-mailer-bundle/feed)WikiDiscussions master Synced 6d ago

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

MailerBundle
============

[](#mailerbundle)

MailerBundle add a new **TemplatedEmail** class for the [Symfony Mailer Component](https://symfony.com/doc/current/components/mailer.html).

Install
-------

[](#install)

```
composer require jacquesndl/mailer-bundle
```

Setup
-----

[](#setup)

The bundle provides an official recipe to help you configure the bundle.

```
# config/packages/jacquesndl_mailer.yaml

jacquesndl_mailer:
    sender:
        name: '%env(JACQUESNDL_MAILER_SENDER_NAME)%'
        address: '%env(JACQUESNDL_MAILER_SENDER_ADDRESS)%'
```

```
# .env

JACQUESNDL_MAILER_SENDER_NAME="Example"
JACQUESNDL_MAILER_SENDER_ADDRESS="example@domain.tld"

```

The env variables **JACQUESNDL\_MAILER\_SENDER\_NAME** and **JACQUESNDL\_MAILER\_SENDER\_ADDRESS** define the default value for the sender. You can overwrite it using the **to()** method of the **TemplatedEmail** class. You can see an example below.

Usage
-----

[](#usage)

### Basic

[](#basic)

```
// src/Controller/WelcomeController.php

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\HttpFoundation\Response;
use Jacquesndl\MailerBundle\Message\TemplatedEmail;

class WelcomeController extends AbstractController
{
    public function index(MailerInterface $mailer): Response
    {
        // ...

        $email = (new TemplatedEmail())
            ->from('didier.deschamps@france.fr') // overwrite the default sender value
            ->to('zinedine.zidane@france.fr')
            ->replyTo('fabien.barthez@france.fr')
            ->template('emails/welcome.email.twig')
            ->attachFromPath('/path/to/documents/coupe-du-monde-1998.pdf')
            ->context([
                'firstName' => 'Zinédine',
            ])
        ;

        $mailer->send($email);

        // ...
    }
}
```

```
{# templates/emails/welcome.email.twig #}

{% block subject %}
   Welcome
{% endblock %}

{% block html %}

   Welcome {{ firstName }}

{% endblock %}

{% block text %}
   Your text content
{% endblock %}
```

If the block **text** is missing or empty, mailer will generate it automatically by converting the HTML contents into text. If you have [league/html-to-markdown](https://github.com/thephpleague/html-to-markdown) installed in your application, it uses that to turn HTML into Markdown (so the text email has some visual appeal). Otherwise, it applies the [strip\_tags](https://secure.php.net/manual/en/function.strip-tags.php) PHP function to the original HTML contents.

### Advanced

[](#advanced)

The bundle provides a **maker** command to create an **Email** class that extends **TemplatedEmail**

```
php bin/console make:email WelcomeEmail
```

```
// src/Email/WelcomeEmail.php

namespace App\Email;

use Jacquesndl\MailerBundle\Message\TemplatedEmail;

class WelcomeEmail extends TemplatedEmail
{
   protected $template = 'emails/welcome.email.twig';
}
```

```
// src/Controller/WelcomeController.php

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\HttpFoundation\Response;
use App\Email\WelcomeEmail;

class WelcomeController extends AbstractController
{
    public function index(MailerInterface $mailer): Response
    {
        // ...

        $email = (new WelcomeEmail())
            ->to('zinedine.zidane@france.fr');

        $mailer->send($email);

        // ...
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Total

3

Last Release

2158d ago

### Community

Maintainers

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

---

Tags

symfonybundleMailerBundleJacquesndl

### Embed Badge

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

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

###  Alternatives

[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29733.3k](/packages/sulu-skeleton)[mcfedr/awspushbundle

A set of services to simplify using Aws to send push notifications

40378.6k1](/packages/mcfedr-awspushbundle)[scullwm/mailhookbundle

A bundle to catch API webhook from differents mail service

4020.5k](/packages/scullwm-mailhookbundle)

PHPackages © 2026

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