emil/inliner

11,353 19
Install
composer require emil/inliner
Latest Version:2.0.0
PHP:>=5.4.0
Laravel:4 · 5
License:MIT
Last Updated:Mar 12, 2016
Links: GitHub  ·  Packagist
Maintainer: emilsundberg

Laravel HTML Email Inliner

To make HTML email work, you need to put all CSS rules inline to make sure it works everywhere. It's a pain when developing your code and that's why you want a package to do it on the fly.

This is just a Laravel wrapper for PHP-premailer (https://github.com/onassar/PHP-Premailer)

Installation

Ruby gems

This package require two Ruby Gems: Premailer and Getopt.

$ sudo gem install premailer
$ sudo gem install getopt

Check this Gists for more info on dependencies on Ubuntu (Laravel Homestead): https://gist.github.com/emilsundberg/8ae10ca886058c683d13

Laravel

Begin by installing this package through Composer.

$ composer require snowfire/beautymail

Add Inliner as a service provider in app.php

'providers' => [
	Emil\Inliner\InlinerServiceProvider::class,
]

Add Inliner alias

'aliases' => [
	Emil\Inliner\Facades\Laravel\Inliner::class
]

Laravel 4.2

Use the 1.x releases/branch

Quick Example

Disable/enable the inliner

The inliner is enabled by default

Inliner::disable();
Inliner::enable();
Check if the inliner is enabled/disabled
Inliner::isDisabled();
Inliner::isEnabled();
Change an option
Inliner::setOption('name', value);

Sending in an option that does not exist will throw InvalidArgumentException

Options
  • css_to_attributes
  • include_link_tags
  • include_style_tags
  • input_encoding
  • preserve_reset
  • preserve_styles
  • remove_classes
  • remove_comments
  • remove_ids
  • remove_scripts
  • replace_html_entities

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660

Version History

Version Released PHP Laravel License
2.0.0 >=5.4.0 4.*|5.* MIT
v1.0.2 >=5.4.0 4.*|5.* MIT
v1.0.1 >=5.4.0 4.* MIT
v1.0.0 >=5.4.0 4.* MIT