Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fedeisas/laravel-mail-css-inliner

Inline the CSS of your HTML emails using Laravel
https://github.com/fedeisas/laravel-mail-css-inliner

Last synced: about 2 months ago
JSON representation

Inline the CSS of your HTML emails using Laravel

Awesome Lists containing this project

README

        

Laravel Mail CSS Inliner
========================

![](https://github.com/fedeisas/laravel-mail-css-inliner/workflows/CI/badge.svg)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=fedeisas/laravel-mail-css-inliner&identifier=16568832)](https://dependabot.com)
[![Latest Stable Version](https://poser.pugx.org/fedeisas/laravel-mail-css-inliner/v/stable.png)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)
[![Latest Unstable Version](https://poser.pugx.org/fedeisas/laravel-mail-css-inliner/v/unstable.png)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)
[![Total Downloads](https://poser.pugx.org/fedeisas/laravel-mail-css-inliner/downloads.png)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)
[![License](https://poser.pugx.org/fedeisas/laravel-mail-css-inliner/license.png)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)

## 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

Starting with version 5 this package requires PHP 8.0 and Laravel 9.0 or higher.

## Using an older version of PHP / Laravel?

If you are on a PHP version below 8.0 or a Laravel version below 9.0 just use version 4.* of this package.

## 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:
```html
<html>
<head>
<style>
h1 {
font-size: 24px;
color: #000;
}



Hey you


Hey you



Hey you