PHPackages                             fbeen/mailerbundle - 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. fbeen/mailerbundle

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

fbeen/mailerbundle
==================

This bundle is a tiny layer on top of the Swift Mailer Bundle that is included in each standard Symfony framework

v1.0.3(8y ago)0942MITPHP

Since Oct 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Fbeen/MailerBundle)[ Packagist](https://packagist.org/packages/fbeen/mailerbundle)[ RSS](/packages/fbeen-mailerbundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)DependenciesVersions (5)Used By (2)

FbeenMailerBundle
=================

[](#fbeenmailerbundle)

This bundle is a tiny layer on top of the Swift Mailer Bundle that is included in each standard Symfony framework

### Features include:

[](#features-include)

- Mailer helper class
- less configuration
- standard twig layout with optional logo
- easy configuration for used mailaddresses
- method to render example views

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

[](#installation)

Using composer:

1. Add `"fbeen/mailerbundle": "dev-master"` to the require section of your composer.json project file.

```
    "require": {
        ...
        "fbeen/mailerbundle": "dev-master"
    },

```

2. run composer update:

    $ composer update
3. Add the bundle to the app/AppKernel.php:

```
        $bundles = array(
            ...
            new Fbeen\MailerBundle\FbeenMailerBundle(),
        );

```

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

[](#configuration)

Take a look at this configuration example:

```
fbeen_mailer:
    company_name: "php-programmer.nl"
    company_logo: "https://www.php-programmer.nl/images/logo.png"
    mailaddresses:
        noreply:
            email: no-reply@example.com                   # required
            name: example.com                             # optional
        general:
            email: info@example.com                       # required
            name: example.com                             # optional
        admins:
            - {email: 'admin1@gmail.com', name: 'Admin1'} # at least one required, name is optional
            - {email: 'admin2@gmail.com'}

```

If the company\_logo is a full URL then it will be used directly. Otherwise The mailer class will use treat it as an asset.

**noreply:** This is the ***From*** that the receiver will see in his email.

**general:** This is the ***Reply-to*** that will be set by default. if the receiver replies than you will receive his mail on this mailaddress

**admins:** This is the ***To*** of the receiver(s) set by default.

**using names gives less spamscore**

How to use
----------

[](#how-to-use)

This can be easily shown with a few examples:

To send an email to the admins you don't need to use setTo()

```
/*
 * send an email to the admins
 */
 $this->get('fbeen_mailer')
    ->setSubject('New contact request!')
    ->setTemplate('email/contact_request.html.twig')
    ->setData(array(
        'name' => $name,
        'email' => $email,
        'message' => $message,
     ))
    ->sendMail()
;

```

To send an email to a user you will have to use setTo()

```
/*
 * send an email to the user
 */
 $this->get('fbeen_mailer')
 	->setTo($user->getEmail())
    ->setSubject('Welcome on board!')
    ->setTemplate('email/welcome.html.twig')
    ->setData(array(
        'user' => $user,
     ))
    ->sendMail()
;

```

The mailer class will add addional data to the array before calling twig:

- companyName (the name of your company from the configuration)
- companyLogo (the path or full URL to an image of your choice)
- urlHomepage (the full URL to the "/" path of your website)
- subject (The subject that has been set by setSubject(); )

So for example 2 you could have a pair of templates as below.

***layout.html.twig:***

```

        {% if companyLogo %}{% else %}{{ companyName }}{% endif %}

            {% block body %}{% endblock %}

            Sincerely,

            {{ companyName }}

```

***welcome.html.twig:***

```
{% extends 'email/layout.html.twig' %}

{% block body %}

            {{ subject }}

            Hi {{ user.name }}, Welcome to our community.

{% endblock %}

```

To render a page with an example content of the email:

```
namespace AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class DefaultController extends Controller
{
    public function emailAction()
    {
        $user = new User();

        $user->setName('Frank Beentjes');
        $user->setEmail('frank@example.org');

        return new Response(
        	$this->get('fbeen_mailer')
            	->setSubject('Welcome on board!')
            	->setTemplate('email/welcome.html.twig')
            	->setTemplate('email/'.$blockname.'.html.twig')
            	->setData(array(
                	'user' => $user
            	))
            	->renderView()
        );
    }
}

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

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

Total

4

Last Release

3203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1cc8c2d6ff35eeecef4931e636ffd89fc2e84dd772a0168f506ae23d4e5720e7?d=identicon)[fbeen](/maintainers/fbeen)

---

Top Contributors

[![Fbeen](https://avatars.githubusercontent.com/u/2814747?v=4)](https://github.com/Fbeen "Fbeen (8 commits)")

---

Tags

Swift\_Mailer

### Embed Badge

![Health badge](/badges/fbeen-mailerbundle/health.svg)

```
[![Health](https://phpackages.com/badges/fbeen-mailerbundle/health.svg)](https://phpackages.com/packages/fbeen-mailerbundle)
```

###  Alternatives

[mattketmo/email-checker

Throwaway email detection library

2742.1M5](/packages/mattketmo-email-checker)[sarfraznawaz2005/noty

Laravel package to incorporate noty flash notifications into laravel.

324.5k](/packages/sarfraznawaz2005-noty)

PHPackages © 2026

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