embaked ~master

HTML baking library


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

embaked

D library to bake HTML, CSS, and images into simple HTML.

This is useful for sending nice HTML emails with low spam score.

Uses htmld and cssd.

Example usage:

import embaked;

auto baked = embake(`
  <html>
    <style>
      h1 {
        background:black;
      }
    </style>
    <link rel=stylesheet href="/css/email.css" />
    <body>
      <h1>mooooo</h1>
      <img src="/flags/PT.png" alt="pt" />
    </body>
  </html>`, Options.Default | Options.BakeContentID, [ "/var/local/www/assets/" ]);

  writeln(baked.html);
  foreach(c; baked.content)
    writeln("replaced content: ", c.id); // c.content, c.mime, c.encoding also available

Output:

<html>
  <body style="background-color:#fff;color:#343a3f;font-family:Arial;font-size:14px;line-height:18px;margin:0;">
    <h1 style="background:black;font-family:Arial;font-weight:700;line-height:18px;margin:9px 0;">mooooo</h1>
    <img src="cid:dedce7cf4811cb3ae93044d400b3d603" />
  </body>
</html>
replaced content: dedce7cf4811cb3ae93044d400b3d603
Authors:
  • Márcio Martins
Dependencies:
htmld, cssd
Versions:
0.1.8 2018-May-17
0.1.7 2017-Aug-09
0.1.6 2016-Dec-01
0.1.5 2016-Nov-30
0.1.4 2015-Aug-26
Show all 10 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 407 downloads total

Score:
1.8
Short URL:
embaked.dub.pm