Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 months ago
JSON representation
Inline the CSS of your HTML emails using Laravel
- Host: GitHub
- URL: https://github.com/fedeisas/laravel-mail-css-inliner
- Owner: fedeisas
- License: mit
- Created: 2014-02-06T04:53:41.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T09:22:17.000Z (4 months ago)
- Last Synced: 2024-08-02T08:26:52.868Z (3 months ago)
- Language: PHP
- Size: 185 KB
- Stars: 583
- Watchers: 12
- Forks: 116
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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