Download the PHP package paulbunyannet/premailer without Composer
On this page you can find all versions of the php package paulbunyannet/premailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download paulbunyannet/premailer
More information about paulbunyannet/premailer
Files in paulbunyannet/premailer
Download paulbunyannet/premailer
More information about paulbunyannet/premailer
Files in paulbunyannet/premailer
Vendor paulbunyannet
Package premailer
Short Description Css inliner for HTML emails
License
Package premailer
Short Description Css inliner for HTML emails
License
Keywords toolkit
Please rate this library. Is it a good library?
Informations about the package premailer
premailer
Inline CSS for use in html emails, uses Dialect Preflight API
install
composer require paulbunyannet/premailer:"^1.0"
Usage
From String
To inline css for a html email from a string:
<?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.
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.
All versions of premailer with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.0 | ^8.0
fakerphp/faker Version ^1.12.0
voku/css-to-inline-styles Version ^2.0
guzzlehttp/guzzle Version ^7.2
fakerphp/faker Version ^1.12.0
voku/css-to-inline-styles Version ^2.0
guzzlehttp/guzzle Version ^7.2
The package paulbunyannet/premailer contains the following files
Loading the files please wait ....