PHPackages                             wiredmedia/to-inline-style-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. wiredmedia/to-inline-style-email-bundle

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

wiredmedia/to-inline-style-email-bundle
=======================================

A Symfony2 bundle for using the CssToInlineStyles translator by tijsverkoyen

3.4.x-dev(13y ago)0546MITPHPPHP &gt;=5.3.3

Since Jun 6Pushed 8y ago2 watchersCompare

[ Source](https://github.com/wiredmedia/ToInlineStyleEmailBundle)[ Packagist](https://packagist.org/packages/wiredmedia/to-inline-style-email-bundle)[ Docs](http://github.com/robertotru/ToInlineStyleEmailBundle)[ RSS](/packages/wiredmedia-to-inline-style-email-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

ToInlineStyleEmailBundle
========================

[](#toinlinestyleemailbundle)

**ToInlineStyleEmailBundle** is a *Symfony2* bundle to use the **CssToInlineStyles** translator by *Tijs Verkoyen* (see  for the repository)

Requirements
============

[](#requirements)

**ToInlineStyleEmailBundle** is only supported on **PHP 5.3.3** and up.

Installation
============

[](#installation)

Please, use the *Composer* to install this bundle in your Symfony2 app.

The following lines should be added in your `composer.json`

```
    "require": {
        "tijsverkoyen/css-to-inline-styles": "dev-master",
        "robertotru/to-inline-style-email-bundle": "dev-master"
    },

```

Then, register the bundle in your AppKernel by adding the following line:

```
    new RobertoTru\ToInlineStyleEmailBundle\RobertoTruToInlineStyleEmailBundle(),
```

Documentation and Examples
==========================

[](#documentation-and-examples)

The bundle provides a service named **css\_to\_inline\_email\_converter**. Use it in a controller to have a nice shortcut to the converter developed by *Tijs Verkoyen*. E.g.:

```
   public function indexAction() {
     $converter = $this->get('css_to_inline_email_converter');
     ...
   }
```

Get the HTML and the CSS as a string and set this required values to the converter object, e.g.

```
   $converter = $this->get('css_to_inline_email_converter');

   $html = ...; // get the HTML here
   $css = ....; // get the CSS here

   $converter->setHTML($html);
   $converter->setCSS($css);
```

The retrieval of the HTML and CSS files from its folder it is only up-to you. E.g. in your controller retrieve the content of your CSS as:

```
  file_get_contents($this->container->getParameter('kernel.root_dir').
    '/../src/Acme/TestBundle/Resources/css/mystyle.css');
```

Of course, it is supposed that a Symfony user will use a template instead of a static HTML page. Hence, for convenience, the service provides a function capable to render a template. E.g.:

```
     $converter->setHTMLByView('AcmeTestBundle:MyController:my_template.html.twig',
       array('param_1'=>$val_of_param_1, ..., 'param_n'=>$val_of_param_n));
   }
```

The preceding function must be used *in vece* of function `setHTML()`.

Read the docs in the files for further details on the usage of the service.

Contributing
============

[](#contributing)

**ToInlineStyleEmailBundle** is an open source project. Contributions are encouraged. Feel free to contribute to improve this bundle.

About the author of the bundle
==============================

[](#about-the-author-of-the-bundle)

**ToInlineStyleEmailBundle** has been originally developed and is mantained by Roberto Trunfio (see more on the author at [www.trunfio.it](http://www.trunfio.it))

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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

4774d ago

Major Versions

2.1.x-dev → 3.4.x-dev2013-06-06

### Community

Maintainers

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

---

Top Contributors

[![robertotru](https://avatars.githubusercontent.com/u/2987914?v=4)](https://github.com/robertotru "robertotru (22 commits)")[![stevelacey](https://avatars.githubusercontent.com/u/289531?v=4)](https://github.com/stevelacey "stevelacey (1 commits)")

---

Tags

symfonybundlecssstyleemailinline

### Embed Badge

![Health badge](/badges/wiredmedia-to-inline-style-email-bundle/health.svg)

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

###  Alternatives

[robertotru/to-inline-style-email-bundle

A Symfony2 bundle for using the CssToInlineStyles translator by tijsverkoyen

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

A Symfony2 bundle for using the CssToInlineStyles translator by tijsverkoyen

59313.7k](/packages/gushphp-to-inline-style-email-bundle)[inlinestyle/inlinestyle

Apply CSS stylesheets directly as inline styles to a HTML document

144658.7k13](/packages/inlinestyle-inlinestyle)[voku/css-to-inline-styles

Only a Fork of -&gt; CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

20262.1k2](/packages/voku-css-to-inline-styles)[illuminate/mail

The Illuminate Mail package.

5910.6M490](/packages/illuminate-mail)

PHPackages © 2026

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