Encode HTML as UTF-8 before base64 encoding

I had some issues with email templates that contained UTF-8 characters during the base64 encoding in the previews. Encoding the HTML as UTF-8 before applying ``b64encode`` fixed the problem for me. What do you think about it? Let me know if there's more that need to be done for this to get considered for merging.