Monthly Archive for August, 2011

Custom Premailer Modifications


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method CodeColorerLoader::CallBeforeHighlightCodeBlock() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 170

Strict Standards: Non-static method CodeColorer::GetInstance() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer.php on line 218

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer-core.php on line 53

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer-core.php on line 54

Warning: shuffle() expects parameter 1 to be array, null given in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/wordpress-support/wordpress-support.php(10) : runtime-created function(1) : eval()'d code(1) : eval()'d code on line 1

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method CodeColorerLoader::CallAfterHighlightCodeBlock() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 170

Strict Standards: Non-static method CodeColorer::GetInstance() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-content/plugins/codecolorer/codecolorer.php on line 226

I’ve had to do quite a bit of email newsletter design recently and I’ve become very familiar with premailer, an awesome open source email preprocessing library that makes developing emails a little more sane.

My workflow is a bit different than what premailer expects out of the box, and there are a couple of improvements that I wanted to add to the project. I’ve forked the project, merged in some other users’ improvements,¬†and made a couple customizations:

  • In plain text mode, links and the parentheses surrounded the links, will not be broken up onto separate lines
  • Images will be replaced by their alt text
  • Instead of using the remote CSS file <link />ed in the HTML when using –base-path premailer will search for the local CSS file based on the path of the input file and use that if available. This is helpful when you have a local CSS file that you want to use to ‘compile’ the email newsletter HTML but have a different CSS file on the server that you want to use to display the email on your website.
  • Unmergable styles will be written into the body (makes a little easier for copying output into iContact and other ESPs)
  • The MailChimp reset styles will be preserved

Just an FYI for anyone looking for similar modifications to the default premailer.





Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2::init_scripts() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 405

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2::setup_rolling_archives() should not be called statically in /home/iloveitaly/mabblog.com/blog/wp-includes/plugin.php on line 405