LaravelPackages.net
Acme Inc.
Toggle sidebar
nautiyal/laravel-mail-css-inliner

Laravel 5 Mail CSS Inliner Service

33
0
v1.2
About nautiyal/laravel-mail-css-inliner

nautiyal/laravel-mail-css-inliner is a Laravel package for laravel 5 mail css inliner service. It currently has 0 GitHub stars and 33 downloads on Packagist (latest version v1.2). Install it with composer require nautiyal/laravel-mail-css-inliner. Discover more Laravel packages by nautiyal or browse all Laravel packages to compare alternatives.

Last updated

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 nautiyal/laravel-mail-css-inliner.

This package requires Laravel 5.x

$ composer require nautiyal/laravel-mail-css-inliner

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

Nautiyal\MailCssInliner\MailCssInlinerProvider::class,

Found a bug?

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

License

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

Comments