Premailer CLI Wrapper
This library is a PHP CLI wrapper for Premailer. Premailer is a tool to inline all of your CSS to ensure best compatibility with email clients.
Premailer is written in Ruby, but can be accessed via a CLI. You will first need to install the Rubygem:
sudo gem install premailer
Install via Composer
To install AddressFormat as a Composer package add this to your composer.json:
"adamlc/premailer-cli-wrapper": "dev-master"
Run composer update
Usage Instructions
WARNING! This library currently doesn't have any unit tests and very much error checking. It will develop over time as I begin to use it in Production.
<?php
use Adamlc\Premailer\Command;
use Adamlc\Premailer\Email;
$command = new Command('/usr/bin/premailer');
$email = new Email($command);
$email->setBody('<h1>Hello world</h1>');
$html = $email->getHtml();
$text = $email->getText();
Thats pretty much it!
##TODO
- Write some unit tests.
- Error checking / Exceptions
- Use filesystem abstraction library
- Additional Premailer options. Such as remove scripts etc