Inline the css of your html emails

0.7.0 2021-01-18 10:15 UTC

This package is auto-updated.

Last update: 2024-06-18 17:54:15 UTC


Swift Mailer CSS Inliner Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version

Swift Mailer plugin inlining the CSS (in style tags) into the specific html tags. Uses CssToInlineStyles. Works for both html body or html parts.


$ composer require openbuildings/swiftmailer-css-inliner


use Openbuildings\Swiftmailer\CssInlinerPlugin;

$mailer = Swift_Mailer::newInstance();

$mailer->registerPlugin(new CssInlinerPlugin());

You can set custom parameters by providing your own CssToInlineStyles object. Like this

use Openbuildings\Swiftmailer\CssInlinerPlugin;
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

$mailer = Swift_Mailer::newInstance();

$converter = new CssToInlineStyles();

$mailer->registerPlugin(new CssInlinerPlugin($converter));


Copyright © Clippings Ltd. Created by Clippings team and contributors.

Under BSD-3-Clause license, read LICENSE file.