2017 © Pedro Peláez
 

library premailer

Css inliner for HTML emails

image

paulbunyannet/premailer

Css inliner for HTML emails

  • Tuesday, January 24, 2017
  • by paulbunyannet
  • Repository
  • 3 Watchers
  • 1 Stars
  • 2,751 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

premailer

Inline CSS for use in html emails, uses Dialect Preflight API, (*1)

install

composer require paulbunyannet/premailer:"^1.0"

Usage

From String

To inline css for a html email from a string:, (*2)

<?php
require_once 'vendor/autoload.php';

$html = '<html>
        <head>
            <style>
                .paragraph {
                    font-size: 12px;
                }
            </style>
        </head>
        <body>
            <p class="paragraph">Lorem ipsum dolor sit amet, ne sea sumo laudem. Iracundia concludaturque no pro. Ex tempor praesent eos, ea dicta consetetur ius, eligendi posidonium referrentur cum no. Nulla dissentiet vel et, mei at sumo numquam, pro iriure constituam voluptatibus te. Affert fabulas impedit nec an, aeterno partiendo voluptaria duo ne.</p>
        </body>
     </html>';

$inlined = Premailer::html($html);         

This will result in the .paragraph class attributes being injected into the paragraph tag it's used in., (*3)

From a url

<?php
require_once 'vendor/autoload.php';
$url = 'https://google.com';     
$inlined = Premailer::url($url);

Response

Both responses will return keys "html", the html string with inlined css, and "plain", a plain text version of the html provided, on success or exception on error., (*4)

The Versions

24/01 2017

dev-master

9999999-dev

Css inliner for HTML emails

  Sources   Download

The Requires

 

The Development Requires

toolkit

24/01 2017

1.1.1

1.1.1.0

Css inliner for HTML emails

  Sources   Download

The Requires

 

The Development Requires

toolkit

08/10 2015

1.1.0

1.1.0.0

Css inliner for HTML emails

  Sources   Download

The Requires

 

The Development Requires

toolkit

07/10 2015

1.0.0

1.0.0.0

Css inliner for HTML emails

  Sources   Download

The Requires

 

The Development Requires

toolkit