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

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

grizzlylab/mailer-bundle
========================

Basic mailer

2.0.2(5y ago)316.1k↓50%MITPHPPHP &gt;=7.4

Since Oct 17Pushed 4y ago1 watchersCompare

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

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

GrizzlylabMailerBundle
======================

[](#grizzlylabmailerbundle)

Symfony bundle to send an e-mail with just one line of code. It uses "symfony/twig-bundle" and "symfony/swiftmailer-bundle".

### 1. Requirements

[](#1-requirements)

Since 2.0, PHP 7.4+ is required and dependency "symfony/twig-bundle" replaces "symfony/templating". It means this bundle now only supports Twig.

Since 1.3, important changes have been made to [dependencies](composer.json).

Since 1.2.1, PHP 7.1+ is required. Before this release, PHP 5.4 is the minimum required.

### 2. Installation

[](#2-installation)

Run the command below to install via [composer](https://packagist.org)

```
composer require grizzlylab/mailer-bundle "~2.0"
```

Then enable it in your kernel:

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        //...
        new Grizzlylab\Bundle\MailerBundle\GrizzlylabMailerBundle()
        //...
```

### 3. Configuration

[](#3-configuration)

#### Configure parameters.yml

[](#configure-parametersyml)

```
#app/config/parameters.yml (advice, set it in "parameters.yml.dist" also)
    #...
    mailer_sender_address: noreply@domain.com #required, will be injected in mailer service
    mailer_sender_name: GrizzlyLab #required, will be injected in mailer service
    #...
```

#### Configure SwiftMailer (if not already done)

[](#configure-swiftmailer-if-not-already-done)

```
#SwifMailer Configuration
swiftmailer:
    transport:      "%mailer_transport%"
    encryption:     "%mailer_encryption%"
    auth_mode:      "%mailer_auth_mode%"
    host:           "%mailer_host%"
    port:           "%mailer_port%"
    username:       "%mailer_user%"
    password:       "%mailer_password%"
    spool:          { type: memory }
    sender_address: "%mailer_sender_address%"
```

#### OPTIONAL: You can use your new parameters (defined in parameters.yml) in your SwiftMailer configuration

[](#optional-you-can-use-your-new-parameters-defined-in-parametersyml-in-your-swiftmailer-configuration)

This way, even if you send an e-mail without "grizzlylab\_mailer", the "sender\_address" will be the same.

```
#app/config/config.yml
#SwifMailer Configuration
swiftmailer:
    #...
    sender_address: "%mailer_sender_address%"
    #...
```

### 4. Use

[](#4-use)

##### 1. Content:

[](#1-content)

###### a) By default, the $content argument is the location of a Twig template:

[](#a-by-default-the-content-argument-is-the-location-of-a-twig-template)

```
$container->get('grizzlylab_mailer')->send('@AcmeUser/Mail/awesome.txt.twig', $emails);
```

Rules inside your Twig template:

- use the first line as the subject
- use the rest as the body

###### b) If you just want to use a simple string, set the argument $contentIsATemplate to false

[](#b-if-you-just-want-to-use-a-simple-string-set-the-argument-contentisatemplate-to-false)

```
$container->get('grizzlylab_mailer')->send('@AcmeUser/Mail/awesome.txt.twig', $emails, null, [], false);
```

##### 2. More examples

[](#2-more-examples)

```
//send($content, $addresses, $subject = null, array $templateParameters = [], $contentIsATemplate = true, array $sender = null)
//If the content is a template and if the subject is null, we use the first line of the template as the subject && the rest as the body

// for a single recipient, second arguement is a string (e.g. 'recipient@domain.com')
$this->container->get('grizzlylab_mailer')->send($content, $address);

// for multiple recipients, second arguement is an array
$this->container->get('grizzlylab_mailer')->send($content, $addresses);

// you can override the sender
$sender = ['address' => adresse@domain.com, 'name' => 'GrizzlyLab'];
$this->container->get('grizzlylab_mailer')->send($content, $addresses, $sender);

// the return value is the number of recipients who were accepted for delivery
$numberOfAcceptedRecipients = $this->container->get('grizzlylab_mailer')->send($content, $addresses, $sender);
```

That's it!

License
-------

[](#license)

This bundle is under the MIT license.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity71

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

Recently: every ~222 days

Total

16

Last Release

1827d ago

Major Versions

1.3.0.1 → 2.0.02020-05-04

PHP version history (3 changes)1.0.0PHP &gt;=5.4

1.2.1.1PHP &gt;=7.1

2.0.0PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

[![grizzlylab](https://avatars.githubusercontent.com/u/2612537?v=4)](https://github.com/grizzlylab "grizzlylab (22 commits)")

---

Tags

mailerswiftmailer

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[yuan1994/tp-mailer

A powerful and beautiful php mailer for All of ThinkPHP and Other PHP Frameworks based SwiftMailer

812.0k1](/packages/yuan1994-tp-mailer)[andrewdyer/slim3-mailer

Email support for the Slim Framework using Twig and Swift Mailer.

1032.7k](/packages/andrewdyer-slim3-mailer)[cattong/think-mailer

A powerful and beautiful php mailer for All of ThinkPHP and Other PHP Frameworks based SwiftMailer

361.9k1](/packages/cattong-think-mailer)

PHPackages © 2026

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