adamlc/premailer-cli-wrapper
最新稳定版本:0.0.4
Composer 安装命令:
composer require adamlc/premailer-cli-wrapper
包简介
PHP CLI wrapper for Premailer (https://github.com/premailer/premailer)
README 文档
README
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": "0.0.*"
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; //Path to Premailer Binary $command = new Command('/usr/bin/premailer'); //Create a new email instance, passing the Command instance $email = new Email($command); //Set the body of the Email $email->setBody('<h1>Hello world</h1>'); //Get the parsed body of the email $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
统计信息
- 总下载量: 18.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-04-17