PHPackages                             illarra/email-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. [Templating &amp; Views](/categories/templating)
4. /
5. illarra/email-bundle

AbandonedArchivedSymfony-bundle[Templating &amp; Views](/categories/templating)

illarra/email-bundle
====================

Create beautiful emails in Symfony2

0.3.0(12y ago)13.8k[3 issues](https://github.com/illarra/IllarraEmailBundle/issues)MITPHPPHP &gt;=5.4

Since Jun 22Pushed 12y ago1 watchersCompare

[ Source](https://github.com/illarra/IllarraEmailBundle)[ Packagist](https://packagist.org/packages/illarra/email-bundle)[ Docs](https://github.com/illarra/IllarraEmailBundle)[ RSS](/packages/illarra-email-bundle/feed)WikiDiscussions master Synced 3w ago

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

Illarra Email Bundle
====================

[](#illarra-email-bundle)

[![Build Status](https://camo.githubusercontent.com/378a94828decc0a413d7043072facb74c3447011a8e7b54e4893347c4a798e40/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f696c6c617272612f496c6c61727261456d61696c42756e646c652e706e67)](http://travis-ci.org/illarra/IllarraEmailBundle) [![Total Downloads](https://camo.githubusercontent.com/61ee1e42ed8fbddf4f164c7374f742e247d7389c5148f694f879f69ff5319c44/68747470733a2f2f706f7365722e707567782e6f72672f696c6c617272612f656d61696c2d62756e646c652f642f746f74616c2e706e67)](https://packagist.org/packages/illarra/email-bundle) [![Latest Stable Version](https://camo.githubusercontent.com/6440b8476011b7a19e6dec597a604bfcf99407c132470eba25d1dcc3ec6daffe/68747470733a2f2f706f7365722e707567782e6f72672f696c6c617272612f656d61696c2d62756e646c652f76657273696f6e2e706e67)](https://packagist.org/packages/illarra/email-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/9c508c0330223efb68141c1b2b020ab925dadfa69c76b63c654602e9c0ee2a6e/68747470733a2f2f706f7365722e707567782e6f72672f696c6c617272612f656d61696c2d62756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/illarra/email-bundle)

This bundle let's you create HTML emails with inline styles using Twig as the template language. It's made of two services:

- Renderer: Updates the given Swift\_Message using a Twig layout/template and css.
- Mailer: It's a wrapper for the default "@mailer" service which let's you use profiles to tell who is sending the email.

```
$message = \Swift_Message::newInstance();

$this->get('illarra.email.renderer')->updateMessage(
    $message,
    'AcmeEmailBundle:Email:layout.html.twig',
    'AcmeEmailBundle:Email:signup/eu.html.twig',
    '@AcmeEmailBundle/Resources/assets/css/email.css',
    [
        'name' => 'Bartolo',
    ]
);

$message->setTo(['bartolo@example.com' => 'Bartolo']);

$this->get('illarra.email.mailer')->send('maritxu', $message);
```

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

[](#configuration)

`config.yml`:

```
illarra_email:
  # Force double quotes in HTML tag attributes,  =>
  # This is usefull for Mandrill or other service which needs double quote attributes
  force_double_quotes: false

  # Generate plain text message from HTML version
  generate_plain: false

  # See "Renderer"
  layout_var:  'layout'
  subject_var: 'subject'

  # See "Mailer"
  profiles: ~
```

Renderer
--------

[](#renderer)

```
$renderer->updateMessage($swift_message, $layout, $template, $css, $data);
```

### Layout &amp; template

[](#layout--template)

Both layout &amp; template need a Twig path. Layout and templates are separated, so that is easier to maintain lot's of templates.

This is the minimum a `$template` needs:

```
{% extends layout %}
{% block subject %}Welcome {{ name }}!{% endblock %}
```

Note that layout in the `extends` tag is a variable which corresponds to the `$layout` given in the updateMessage() method. The `subject` block is used to generate the email subject. **Both are required**.

The names of the layout variable and the subject block can be changed in `config.yml`:

```
illarra_email:
  layout_var:  'layout'
  subject_var: 'subject'
```

### CSS

[](#css)

You can use the `@AcmeBundle/path/my.css` notation to locate your css. This css file will be used to add inline styles to the generated HTML.

Mailer
------

[](#mailer)

```
$mailer->send($profile, $swift_message);
```

Profiles are defined in `config.yml`:

```
illarra_email:
  profiles:
    maritxu:
      from: { maritxu@example.com: Maritxu }
    bartolo:
      from: { no-reply@example.com: Unknown }
      reply_to: { bartolo@example.com: Bartolo }
```

Define the From and ReplyTo options like in a Swift Message: `{'email': 'name'}`. You can define multiple emails in the From parameter, all of them will be visible to the addressee, but only the first one will be the actual Sender.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

4740d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/188612?v=4)[Asier Illarramendi](/maintainers/doup)[@doup](https://github.com/doup)

![](https://avatars.githubusercontent.com/u/514589?v=4)[Eneko](/maintainers/eillarra)[@eillarra](https://github.com/eillarra)

---

Top Contributors

[![doup](https://avatars.githubusercontent.com/u/188612?v=4)](https://github.com/doup "doup (38 commits)")

---

Tags

bundletwigcssstyleemailtemplateinline

### Embed Badge

![Health badge](/badges/illarra-email-bundle/health.svg)

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

###  Alternatives

[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22919.7M81](/packages/twig-cssinliner-extra)[twig/inky-extra

A Twig extension for the inky email templating engine

16613.2M70](/packages/twig-inky-extra)[symfony/ux-twig-component

Twig components for Symfony

22017.2M313](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1636.5M115](/packages/symfony-ux-live-component)[robertotru/to-inline-style-email-bundle

A Symfony2 bundle for using the CssToInlineStyles translator by tijsverkoyen

59386.1k](/packages/robertotru-to-inline-style-email-bundle)[gushphp/to-inline-style-email-bundle

A Symfony2 bundle for using the CssToInlineStyles translator by tijsverkoyen

59313.2k](/packages/gushphp-to-inline-style-email-bundle)

PHPackages © 2026

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