2017 © Pedro Peláez
 

library laravel-mail-css-inliner

Laravel 5 Mail CSS Inliner Service

image

igonics/laravel-mail-css-inliner

Laravel 5 Mail CSS Inliner Service

  • Saturday, June 25, 2016
  • by ggordon
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

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., (*1)

How?

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

Transforming:, (*3)

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

Into this:, (*4)

<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., (*5)

This package requires Laravel 5.x, (*6)

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

Next, update Composer from the Terminal:, (*7)

$ 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., (*8)

'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., (*9)

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., (*10)

License

This package is open-sourced software licensed under the MIT license, (*11)

The Versions

25/06 2016

dev-master

9999999-dev

Laravel 5 Mail CSS Inliner Service

  Sources   Download

MIT

The Requires

 

by Avatar ggordon

25/06 2016

1.0.0

1.0.0.0

Laravel 5 Mail CSS Inliner Service

  Sources   Download

MIT

The Requires

 

by Avatar ggordon

25/06 2016

dev-dev

dev-dev

Laravel 5 Mail CSS Inliner Service

  Sources   Download

MIT

The Requires

 

by Avatar ggordon

25/06 2016

0.0.1

0.0.1.0

Laravel 5 Mail CSS Inliner Service

  Sources   Download

MIT

The Requires

 

by Avatar ggordon