PHPackages                             bummzack/swiftmailer-emogrifyplugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bummzack/swiftmailer-emogrifyplugin

ActiveLibrary

bummzack/swiftmailer-emogrifyplugin
===================================

Inline CSS in the HTML output of SwiftMailer using Emogrifier.

1.0.1(4y ago)122.7k↓58.9%31BSD-3-ClausePHPPHP ^7.2 || ^8.0

Since Feb 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bummzack/swiftmailer-emogrifyplugin)[ Packagist](https://packagist.org/packages/bummzack/swiftmailer-emogrifyplugin)[ RSS](/packages/bummzack-swiftmailer-emogrifyplugin/feed)WikiDiscussions 1 Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (7)Used By (1)

Swift Mailer Emogrify Plugin
============================

[](#swift-mailer-emogrify-plugin)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/eb0cc00f09bae67ead08bc07e298e7cb74adc032248d05b99396dcccd6a32a66/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62756d6d7a61636b2f73776966746d61696c65722d656d6f6772696679706c7567696e2f6261646765732f7175616c6974792d73636f72652e706e673f623d31)](https://scrutinizer-ci.com/g/bummzack/swiftmailer-emogrifyplugin/?branch=1)[![Code Coverage](https://camo.githubusercontent.com/11224bdbecf20a30f85fc61d343b4790cd8d02f979090538198def9b4cc9f607/68747470733a2f2f636f6465636f762e696f2f67682f62756d6d7a61636b2f73776966746d61696c65722d656d6f6772696679706c7567696e2f6272616e63682f312f67726170682f62616467652e737667)](https://codecov.io/gh/bummzack/swiftmailer-emogrifyplugin)[![Build Status](https://camo.githubusercontent.com/b1eb08f3c1e739df0a4f32b488f3996bf8721822f09317915824f04461e05a95/68747470733a2f2f7472617669732d63692e636f6d2f62756d6d7a61636b2f73776966746d61696c65722d656d6f6772696679706c7567696e2e7376673f6272616e63683d31)](https://travis-ci.com/bummzack/swiftmailer-emogrifyplugin)[![Latest Stable Version](https://camo.githubusercontent.com/f1a57f1c5874cab7b53ef2bc48a5114ccc213625be8b3f27ea7369599e5039ff/68747470733a2f2f706f7365722e707567782e6f72672f62756d6d7a61636b2f73776966746d61696c65722d656d6f6772696679706c7567696e2f762f737461626c65)](https://packagist.org/packages/bummzack/swiftmailer-emogrifyplugin)

Inline CSS in the HTML output of SwiftMailer using [Emogrifier](https://github.com/MyIntervals/emogrifier).

Installation and requirements
-----------------------------

[](#installation-and-requirements)

Install via composer, using:

```
composer require bummzack/swiftmailer-emogrifyplugin

```

Requirements:

- PHP 7.2+
- SwiftMailer 6.x
- Emogrifier 6.x

Usage
-----

[](#usage)

By default, the plugin will inline CSS that is part of the HTML, eg. styles defined in `` tags.

### Supplying custom CSS

[](#supplying-custom-css)

```
$plugin = new EmogrifierPlugin();
$plugin->setCss('.customStyle: { color: red; };');
```

### Example

[](#example)

Here's how you could use the plugin to send emails with custom styles loaded from a file:

```
$plugin = new Bummzack\SwiftMailer\EmogrifyPlugin\EmogrifierPlugin();
$emogrifier->setCss(file_get_contents( /* path to your CSS file */ ));

// Create the Mailer using any Transport
$mailer = new Swift_Mailer(
    new Swift_SmtpTransport('smtp.example.org', 25)
);

// Use Emogrifier plugin to inline styles.
$mailer->registerPlugin($plugin);

$message = new Swift_Message();
$message
    ->setSubject('Your subject')
    ->setFrom(['test@example.com' => 'Test'])
    ->setTo(['receiver@example.com'])
    ->setBody('My custom HTML', 'text/html');

// Send your email
$mailer->send($message);
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~299 days

Recently: every ~144 days

Total

6

Last Release

1509d ago

Major Versions

0.x-dev → 1.0.02021-10-11

PHP version history (2 changes)0.1PHP ^5.6 || ^7.0

1.0.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ace339d9696dfdf9e2f3c6abc212a3abb390b0b51fff48285036b7da8f0be098?d=identicon)[bummzack](/maintainers/bummzack)

---

Top Contributors

[![bummzack](https://avatars.githubusercontent.com/u/1006185?v=4)](https://github.com/bummzack "bummzack (16 commits)")[![lozcalver](https://avatars.githubusercontent.com/u/1655548?v=4)](https://github.com/lozcalver "lozcalver (2 commits)")

---

Tags

pluginswiftmaileremogrifier

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bummzack-swiftmailer-emogrifyplugin/health.svg)

```
[![Health](https://phpackages.com/badges/bummzack-swiftmailer-emogrifyplugin/health.svg)](https://phpackages.com/packages/bummzack-swiftmailer-emogrifyplugin)
```

###  Alternatives

[yiisoft/yii2-swiftmailer

The SwiftMailer integration for the Yii framework

11520.0M473](/packages/yiisoft-yii2-swiftmailer)[cspoo/swiftmailer-mailgun-bundle

Swiftmailer Mailgun bundle

1031.1M](/packages/cspoo-swiftmailer-mailgun-bundle)[mailjet/mailjet-swiftmailer

A SwiftMailer transport implementation for Mailjet

261.2M9](/packages/mailjet-mailjet-swiftmailer)[aimeos/ai-swiftmailer

SwiftMailer adapter for Aimeos web shops and e-commerce solutions

20168.3k5](/packages/aimeos-ai-swiftmailer)[markguinn/silverstripe-email-helpers

Silverstripe extension containing SMTP mailer class and some other classes for HTML emails

3145.4k1](/packages/markguinn-silverstripe-email-helpers)[yuan1994/tp-mailer

A powerful and beautiful php mailer for All of ThinkPHP and Other PHP Frameworks based SwiftMailer

812.0k1](/packages/yuan1994-tp-mailer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
