Skip to content

Automatic Inline-CSS for HTML mails

kaikai
edited November 2014 in Using Sendy

Since sendy was missing a feature to automatically inline css (what f.i. Mailchimp does automatically), I created a patch that does exactly that.

You can find it here: RAW Version (save as "inlineCss.patch") or full pastebin.

Because it contains some classes from Symfony, the patch file is relatively big (366kB).

Apply it like so (patch is applied to the "sendy" directory:

patch -s -p0 < inlineCss.patch

Sendy unfortunately doesn't use the same email rendering code for different methods of sending emails (e.g. test sending, immediate sending, scheduled sending, email preview), so I modified these files:

  • w.php (HTML preview)
  • scheduled.php (send scheduled mails)
  • includes/create/send-now.php (send now)
  • includes/create/test-send.php (test email)

If there are any more occurences of rendered HTML mail output, please let me know.

Thanks to tijsverkoyen for his great inline css class: https://github.com/tijsverkoyen/CssToInlineStyles

Also thanks to Fabien Potencier and his team (Symfony) for being awesome: http://symfony.com/

Hope this is helpful.

This discussion has been closed.