An open API service indexing awesome lists of open source software.

https://github.com/adamlc/premailer-cli-wrapper

PHP CLI wrapper for https://github.com/premailer/premailer
https://github.com/adamlc/premailer-cli-wrapper

Last synced: about 1 year ago
JSON representation

PHP CLI wrapper for https://github.com/premailer/premailer

Awesome Lists containing this project

README

          

Premailer CLI Wrapper
=====================

This library is a PHP CLI wrapper for [Premailer](https://github.com/premailer/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:

```bash
sudo gem install premailer
```

## Install via Composer

To install AddressFormat as a Composer package add this to your composer.json:

```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
setBody('

Hello world

');

//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