Skip to content

Simple HTTP wrapper around the Premailer library

Notifications You must be signed in to change notification settings

cakemail/Premailer-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

Configs

Set environment variable RACK_ENV to production if in production. This will make the API listen on port 80 instead of port 4567.

API Documentation

POST /clean

Parameters

Required

  • String html
    • HTML content to be cleaned.

Optional

  • Bool with_warnings (default: 0)

    • When 1, warnings are returned.
  • Bool remove_comments (default: 0)

    • When 1, HTML comments are removed.
  • Bool remove_script_tags (default: 0)

    • When 1, script tags are removed.

Response

{
    "html": "<form style=\"opacity: 0.5; color: red;\"><button>submit</button></form>",
    "warnings": [{
        "level": "RISKY",
        "message": "opacity CSS property",
        "clients": "Outlook 03, Outlook 07, Windows Mail, Entourage 2004, Notes 6, Eudora, New     Yahoo, Old GMail, New GMail, Live Mail, Hotmail"
    }, {
        "level": "SAFE",
        "message": "color CSS property",
        "clients": "Eudora"
    }]
}

About

Simple HTTP wrapper around the Premailer library

Resources

Stars

Watchers

Forks

Packages

No packages published