{"id":13862867,"url":"https://github.com/codekitchen/premailer","last_synced_at":"2025-07-14T13:32:51.116Z","repository":{"id":10064831,"uuid":"12117394","full_name":"codekitchen/premailer","owner":"codekitchen","description":"Preflight for HTML email","archived":false,"fork":true,"pushed_at":"2013-09-04T15:59:35.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-05T06:06:24.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://premailer.dialect.ca/","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"regru/premailer","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codekitchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-14T19:21:20.000Z","updated_at":"2016-12-19T20:09:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codekitchen/premailer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekitchen%2Fpremailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekitchen%2Fpremailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekitchen%2Fpremailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codekitchen%2Fpremailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codekitchen","download_url":"https://codeload.github.com/codekitchen/premailer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225980898,"owners_count":17554919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-05T06:01:54.471Z","updated_at":"2024-11-22T23:30:30.596Z","avatar_url":"https://github.com/codekitchen.png","language":"Ruby","readme":"# Premailer README\n\n## What is this?\n\nFor the best HTML e-mail delivery results, CSS should be inline. This is a \nhuge pain and a simple newsletter becomes un-managable very quickly. This \nscript is my solution.\n\n* CSS styles are converted to inline style attributes\n  - Checks \u003ctt\u003estyle\u003c/tt\u003e and \u003ctt\u003elink[rel=stylesheet]\u003c/tt\u003e tags and preserves existing inline attributes\n* Relative paths are converted to absolute paths\n  - Checks links in \u003ctt\u003ehref\u003c/tt\u003e, \u003ctt\u003esrc\u003c/tt\u003e and CSS \u003ctt\u003eurl('')\u003c/tt\u003e\n* CSS properties are checked against e-mail client capabilities\n  - Based on the Email Standards Project's guides\n* A plain text version is created (optional)\n\n## Premailer 2.0 is coming\n\nI'm looking for input on a version 2.0 update to Premailer.  PLease visit the [Premailer 2.0 Planning Page](https://github.com/alexdunae/premailer/wiki/Premailer-2.0-Planning) and give me your feedback.\n\n## Installation\n\nDownload the Premailer gem from RubyGems.\n\n```bash\ngem install premailer\n```\n\n## Example\n\n```ruby\npremailer = Premailer.new('http://example.com/myfile.html', :warn_level =\u003e Premailer::Warnings::SAFE)\n\n# Write the HTML output\nfout = File.open(\"output.html\", \"w\")\nfout.puts premailer.to_inline_css\nfout.close\n\n# Write the plain-text output\nfout = File.open(\"ouput.txt\", \"w\")\nfout.puts premailer.to_plain_text\nfout.close\n\n# Output any CSS warnings\npremailer.warnings.each do |w|\n  puts \"#{w[:message]} (#{w[:level]}) may not render properly in #{w[:clients]}\"\nend\n```\n\n## Ruby Compatibility\n\nPremailer is tested on Ruby 1.8.7, Ruby 1.9.2 and Ruby 1.9.3 (preview 1). It also works on REE. JRuby support is close; contributors are welcome.  Checkout the latest build status on the [Travis CI dashboard](http://travis-ci.org/#!/alexdunae/premailer).\n\n## Premailer-specific CSS\n\nPremailer looks for a few CSS attributes that make working with tables a bit easier.\n\u003cdl\u003e\n  \u003cdt\u003e-premailer-width\u003c/dt\u003e\n    \u003cdd\u003eAvailable on \u003ctt\u003etable\u003c/tt\u003e, \u003ctt\u003eth\u003c/tt\u003e and \u003ctt\u003etd\u003c/tt\u003e elements\u003c/dd\u003e\n  \u003cdt\u003e-premailer-height\u003c/dt\u003e\n    \u003cdd\u003eAvailable on \u003ctt\u003etable\u003c/tt\u003e, \u003ctt\u003etr\u003c/tt\u003e, \u003ctt\u003eth\u003c/tt\u003e and \u003ctt\u003etd\u003c/tt\u003e elements\u003c/dd\u003e\n  \u003cdt\u003e-premailer-cellpadding\u003c/dt\u003e\n    \u003cdd\u003eAvailable on \u003ctt\u003etable\u003c/tt\u003e elements\u003c/dd\u003e\n  \u003cdt\u003e-premailer-cellspacing\u003c/dt\u003e\n    \u003cdd\u003eAvailable on \u003ctt\u003etable\u003c/tt\u003e elements\u003c/dd\u003e\n\u003c/dl\u003e\n\nEach of these CSS declarations will be copied to appropriate element's attribute.\n\nFor example\n\n```css\ntable { -premailer-cellspacing: 5; -premailer-width: 500;}\n```\n\nwill result in \n\n```html\n\u003ctable cellspacing='5' width='500'\u003e\n```\n\n## Contributions\n\nContributions are most welcome.  Premailer was rotting away in a private SVN repository for too long and could use some TLC.  Fork and patch to your heart's content.  Please don't increment the version numbers, though.\n\nA few areas that are particularly in need of love:\n\n* Improved test coverage\n* Move un-repeated background images defined in CSS for Outlook\n\n## Credits and code\n\nThanks to [all the wonderful contributors](https://github.com/alexdunae/premailer/contributors) for their updates.\n\nThanks to [Greenhood + Company](http://www.greenhood.com/) for sponsoring some of the 1.5.6 updates,\nand to [Campaign Monitor](http://www.campaignmonitor.com) for supporting the web interface.\n\nThe web interface can be found at [premailer.dialect.ca](http://premailer.dialect.ca).\n\nThe source code can be found on [GitHub](https://github.com/alexdunae/premailer).\n\nCopyright by Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007-2012.  See [LICENSE.md](https://github.com/alexdunae/premailer/blob/master/LICENSE.md) for license details.\n\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodekitchen%2Fpremailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodekitchen%2Fpremailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodekitchen%2Fpremailer/lists"}