Wednesday, March 05, 2014

Recently, I reformat our email template and ran into an issue wherein the middle part of the email body is re-populating at the end of the body resulting in duplicate content. The email template was created using Handlebars. My suspect is the character encoding of the production mysql database. But what ever I do (copy the prod DB locally with same encoding, etc), I could not replicate it in my local machine.

Removing the non-printable characters before rendering the content with template fixed it. Here's how I did it.