New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

igonics/laravel-mail-css-inliner

Laravel 5 Mail CSS Inliner Service
3 1

Larablocks Analysis

igonics/laravel-mail-css-inliner works with Laravel 5 (latest release 1.0.0, Jun 25, 2016), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: Jun 25, 2016)
  • 0 downloads a month (needs 10,000)
  • 1 GitHub star (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jun 25, 2016.
  • No releases in the last 12 months.
  • First released: Jun 25, 2016.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require igonics/laravel-mail-css-inliner
Latest Version:1.0.0
PHP:>=5.3.0
Laravel:5
License:MIT
Last Updated:May 15, 2017
Links: GitHub  ·  Packagist
Maintainer: ggordon

Laravel 5 Mail CSS Inliner

Why?

Most email clients won't render CSS (on a <link> or a <style>). The solution is to inline your CSS directly into the HTML. Doing this by hand is tedious and difficult to maintain. The goal of this package is to automate the process of inlining that CSS before sending the emails.

How?

Using a wonderful CSS inliner package wraped in a SwiftMailer plugin and served as a Service Provider. It works without configuration

Transforming:

<html>
    <head>
        <style>
            h1 {
                font-size: 24px;
                color: #000;
            }
        </style>
    </head>
    <body>
        <h1>Your content</h1>
    </body>
</html>

Into this:

<html>
    <head>
    </head>
    <body>
        <h1 style="font-size: 24px; color: #000;">Your content</h1>
    </body>
</html>

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require igonics/laravel-mail-css-inliner.

This package requires Laravel 5.x

{
  "require": {
        "igonics/laravel-mail-css-inliner": "~1.0"
    }
}

Next, update Composer from the Terminal:

$ composer update

Once this operation completes, you must add the service provider. Open app/config/app.php, and add a new item to the providers array.

'IGonics\LaravelMailCssInliner\LaravelMailCssInlinerServiceProvider',

Found a bug?

Please, let me know! Send a pull request or a patch. Questions? Ask! I will respond to all filed issues.

Inspiration

This package was greatly inspired by Emogrifier CSS Inliner and Fede Isas's implementation of a similar service provider. The implementation became less configurable however with its main dependency CssToInlineStyles becoming less configurable with it's latest update which presented breaking changes to the existing API. This package was created as a more configurable solution with the ability to also handle poorly formatted HTML, which the previous implementations had issues with.

License

This package is open-sourced software licensed under the MIT license

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released PHP Laravel License
1.0.0 >=5.3.0 ~5.2 MIT
0.0.1 >=5.3.0 ~5.2 MIT