PHPackages                             ajohnson6494/laravel-symfony-mailer-css-inliner - 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. ajohnson6494/laravel-symfony-mailer-css-inliner

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

ajohnson6494/laravel-symfony-mailer-css-inliner
===============================================

Automate innlining the CSS of your HTML emails using Laravel and Symfony Mailer

v1.3.1(1y ago)014.7k↓41.7%MITPHPPHP ^8.3 || ^8.4CI passing

Since May 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ajohnson6494/laravel-symfony-mailer-css-inliner)[ Packagist](https://packagist.org/packages/ajohnson6494/laravel-symfony-mailer-css-inliner)[ RSS](/packages/ajohnson6494-laravel-symfony-mailer-css-inliner/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

Laravel Symfony Mailer CSS Inliner
==================================

[](#laravel-symfony-mailer-css-inliner)

[![](https://github.com/ajohnson6494/laravel-symfony-mailer-css-inliner/workflows/CI/badge.svg)](https://github.com/ajohnson6494/laravel-symfony-mailer-css-inliner/workflows/CI/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/a3b05c03001ce5e4e4229392ea1dc23628b0499edf0761802daabfa938e93a70/68747470733a2f2f706f7365722e707567782e6f72672f616a6f686e736f6e363439342f6c61726176656c2d73796d666f6e792d6d61696c65722d6373732d696e6c696e65722f762f737461626c652e706e67)](https://packagist.org/packages/ajohnson6494/laravel-symfony-mailer-css-inliner)[![License](https://camo.githubusercontent.com/5be230c444f03a3283185a3a615ef033382e75292fd50555e84b8395ef4d6c80/68747470733a2f2f706f7365722e707567782e6f72672f616a6f686e736f6e363439342f6c61726176656c2d73796d666f6e792d6d61696c65722d6373732d696e6c696e65722f6c6963656e73652e706e67)](https://packagist.org/packages/ajohnson6494/laravel-symfony-mailer-css-inliner)

Why?
----

[](#why)

Most email clients won't render CSS (on a `` or a ``). The solution is inline your CSS directly on the HTML. Doing this by hand easily turns into unmantainable templates. The goal of this package is to automate the process of inlining that CSS before sending the emails.

Installation and compatability
------------------------------

[](#installation-and-compatability)

Requires PHP 8.1 and Laravel 9.0 or higher.

How?
----

[](#how)

Using a wonderful [CSS inliner package](https://github.com/tijsverkoyen/CssToInlineStyles) wrapped in a Symfony Mailer plugin and served as a Service Provider it just works without any configuration. Since this is a Symfony Mailer plugin, it will automatically inline your css when parsing an email template. You don't have to do anything!

Turns style tag:

```

            h1 {
                font-size: 24px;
                color: #000;
            }

        Hey you

```

Or the link tag:

```

        Hey you

```

Into this:

```

            h1 {
                font-size: 24px;
                color: #000;
            }

        Hey you

```

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

[](#installation)

This package needs Laravel 9.x.

Begin by installing this package through Composer. Require it directly from the Terminal to take the last stable version:

```
$ composer require ajohnson6494/laravel-symfony-mailer-css-inliner
```

At this point the inliner should be already working with the default options. If you want to fine-tune these options, you can do so by publishing the configuration file:

```
$ php artisan vendor:publish --provider='ajohnson6494\LaravelSymfonyMailerCssInliner\LaravelMailCssInlinerServiceProvider'
```

and changing the settings on the generated `config/css-inliner.php` file.

Contributing
------------

[](#contributing)

```
$ composer install
$ ./vendor/bin/phpunit
```

Found a bug?
------------

[](#found-a-bug)

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

Inspiration
-----------

[](#inspiration)

This package is greatly inspired, and mostly copied, from [SwiftMailer CSS Inliner](https://github.com/OpenBuildings/swiftmailer-css-inliner). I just made an easy drop-in solution for Laravel.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance48

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

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

Total

5

Last Release

384d ago

PHP version history (4 changes)v1.0.0PHP ^8.0.2

v1.1.0PHP ^8.0.2 || ^8.1

v1.2.0PHP ^8.2 || ^8.3

v1.3.0PHP ^8.3 || ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/17084ad54e16e273b638275e6d4c13d77fc8bde5b6bb8a698e353c96ab8c3067?d=identicon)[ajohnson6494](/maintainers/ajohnson6494)

---

Top Contributors

[![ajohnson6494](https://avatars.githubusercontent.com/u/5192820?v=4)](https://github.com/ajohnson6494 "ajohnson6494 (20 commits)")

---

Tags

laravelcssmailersymfony mailer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ajohnson6494-laravel-symfony-mailer-css-inliner/health.svg)

```
[![Health](https://phpackages.com/badges/ajohnson6494-laravel-symfony-mailer-css-inliner/health.svg)](https://phpackages.com/packages/ajohnson6494-laravel-symfony-mailer-css-inliner)
```

###  Alternatives

[fedeisas/laravel-mail-css-inliner

Inline the CSS of your HTML emails using Laravel

5974.6M3](/packages/fedeisas-laravel-mail-css-inliner)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)

PHPackages © 2026

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