{"id":23419723,"url":"https://github.com/pdroll/better-html-email-development","last_synced_at":"2026-02-15T10:36:15.082Z","repository":{"id":76116351,"uuid":"51191244","full_name":"pdroll/Better-HTML-Email-Development","owner":"pdroll","description":"Modern web development tools to make developing HTML Emails suck less.","archived":false,"fork":false,"pushed_at":"2016-02-06T15:09:55.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T03:03:32.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdroll.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-06T05:42:06.000Z","updated_at":"2016-11-01T19:29:38.000Z","dependencies_parsed_at":"2023-04-28T08:39:24.456Z","dependency_job_id":null,"html_url":"https://github.com/pdroll/Better-HTML-Email-Development","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pdroll/Better-HTML-Email-Development","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2FBetter-HTML-Email-Development","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2FBetter-HTML-Email-Development/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2FBetter-HTML-Email-Development/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2FBetter-HTML-Email-Development/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdroll","download_url":"https://codeload.github.com/pdroll/Better-HTML-Email-Development/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2FBetter-HTML-Email-Development/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29475750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T10:25:47.032Z","status":"ssl_error","status_checked_at":"2026-02-15T10:25:01.815Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-12-23T01:28:09.195Z","updated_at":"2026-02-15T10:36:15.067Z","avatar_url":"https://github.com/pdroll.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"#HTML Email Development That Doesn't Suck*\n\n_*As much_\n\nHTML Email Development sucks. You can't use [even some of the most basic CSS properties](https://www.campaignmonitor.com/css/). You have to rely tables for all layouts. Email clients that you have to support use  [HTML rendering engines](https://litmus.com/blog/a-guide-to-rendering-differences-in-microsoft-outlook-clients) that were [released over a decade ago](https://en.wikipedia.org/wiki/Internet_Explorer_7#Release_history). Things are [better than they used to be](https://litmus.com/help/email-clients/media-query-support/), but it will be a long time before we're able to use modern web development techniques for HTML emails.\n\nBut just because you can't change these things, doesn't mean you have to develop like a caveman.\n\nThis is an attempt to use modern web development tooling to make the task of developing HTML emails less painful.\n\n**[Gulp.js](http://gulpjs.com/)** is used to do the heavy lifting, automatically while you develop:\n\n1. **Assemble HTML**.\n\tUses [fabricator-assemble](https://github.com/fbrctr/fabricator-assemble) to bring elegent use of layouts to Handlebars templates.\n\n\n2. **Compile Sass**.\n\tNever leave home without variables and `@import`'s again.\n\n3. **Inject CSS into `\u003cstyle\u003e` tag**.\n\tThis lets you use things like `:hover` states and media queries.\n\n4. **Inline all CSS properties**.\n\tIt's dumb, but [you have to do it](https://www.campaignmonitor.com/blog/email-marketing/2013/11/introducing-our-new-standalone-css-inliner/). And now it's done for you.\n\n5. **Optimize Images**.\n\tUses [Imagemin](https://github.com/sindresorhus/gulp-imagemin) to seamlessly minify images.\n\n\n## Scripts\n### Run Locally\nTo run locally, while keeping your browser updated in real time using [BrowserSync](https://www.browsersync.io/), you can run:\n\n```\nnpm start\n```\n\n### Build for production\n\nTo package things up when you're ready to send, you can run:\n\n\n```\nnpm run build\n```\n\nLook in the `dist` folder for your compiled HTML and optimized images.\n\n\n## How to Use\n\n\n### Templates\n\nStart building your emails inside the `src/views` folder. Four [responsive email designs](http://foundation.zurb.com/emails/email-templates.html) from Zurb Foundation are included. They are a great starting point, and they come with well lots of [well tested features](http://foundation.zurb.com/emails/docs.html).\n\nEdit these files, or add your own to make your own email design from scratch.\n\n### Layouts\n\nLook in `src/views/layouts` to add or edit different layouts for your emails.\n\nThe layout can be specified for each email via front matter.\n\nFor example:\n\n```html\n\u003c!-- /src/views/layouts/mylayout.html --\u003e\n\n\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\t\u003cdiv id=\"my-cool-container\"\u003e\n\t{% body %}\n\t\u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n```html\n\u003c!-- /src/views/my-email.html --\u003e\n\n---\nlayout : mylayout\n---\n\n\u003ctable class=\"body\"\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\tHTML Emails are the best.\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n```\n\nwould result in\n\n```html\n\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\t\u003cdiv id=\"my-cool-container\"\u003e\n\t\t\u003ctable class=\"body\"\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\u003ctd\u003e\n\t\t\t\t\tHTML Emails are the best.\n\t\t\t\t\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\u003c/table\u003e\n\t\u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n### Components\n\nHTML components that you will be reused can be defined in `src/components`\n\nFor example:\n\n```html\n\u003c!-- src/components/button.html --\u003e\n\u003ctable class=\"button\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"http://facebook.com\"\u003eClick Me\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n```\n\nComponents can be accessed in an email using the `\u003e` syntax:\n\n```\n{{\u003e button }}\n```\n\n### Template Data\n\nData can be passed to templates from the `src/data.json` file.\n\nFor example:\n\n```json\n{\n\t\"imagePath\" : \"images/\",\n\t\"name\"      : \"Pete Droll\"\n}\n```\n\nThat data can be accessed in any HTML like so:\n\n```HTML\n\u003cp\u003eHello, {{ data.name }}\u003c/p\u003e\n\n\u003cimg src=\"{{ data.imagePath }}facebook.png\" alt=\"Facebook\" /\u003e\n\n```\n\n\nCheck out the [fabricator-assemble](https://github.com/fbrctr/fabricator-assemble) docs for more information.\n\n--\n### SCSS\n\nStyles for your emails can be defined in `/src/scss/styles.css`.\n\nWrite all the cool Sass that you know and love, and rest assured it will end up injected into a `\u003cstyle\u003e` tag **and** inlined as style attributes on all matching HTML elements.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdroll%2Fbetter-html-email-development","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdroll%2Fbetter-html-email-development","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdroll%2Fbetter-html-email-development/lists"}