{"id":10309,"date":"2015-11-18T13:30:12","date_gmt":"2015-11-18T13:30:12","guid":{"rendered":"https:\/\/www.heartinternet.uk\/blog\/?p=10309"},"modified":"2015-11-18T13:30:12","modified_gmt":"2015-11-18T13:30:12","slug":"on-designing-emails-part-3-common-hacks-to-fix-your-emails","status":"publish","type":"post","link":"https:\/\/www.heartinternet.uk\/blog\/on-designing-emails-part-3-common-hacks-to-fix-your-emails\/","title":{"rendered":"On Designing Emails: Part 3 \u2013 Common Hacks to Fix Your Emails"},"content":{"rendered":"<p>We&#8217;ve talked about <a href=\"https:\/\/www.heartinternet.uk\/blog\/on-designing-emails-part-1-making-html-emails-work\/\">how to make your HTML emails work<\/a> and <a href=\"https:\/\/www.heartinternet.uk\/blog\/on-designing-emails-part-2-making-your-emails-responsive\/\">how to make them responsive<\/a>, but there will always be problems.  Each mail client is different, the slightest mistake can cause big problems, and it can be a bit of a mess when you&#8217;re trying to debug everything.<\/p>\n<p>I&#8217;m going to go over some of the more common fixes used.  These are what I use to make sure emails look right, and I hope they help you as well.<\/p>\n<h3>Where emails can go wrong<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/designingemails-3-goingwrong.png\" alt=\"Icons of an envelope, an eye, and a desktop and a mobile device\" width=\"600\" height=\"200\" class=\"aligncenter size-full wp-image-10314\" \/><\/p>\n<p>When an email doesn&#8217;t render properly, there are a lot of systems the email has gone through before it shows up incorrect in your email client. Mail servers, pre-processors, rendering engines, and browsers are all major factors affecting how an email renders.<\/p>\n<p>\n<a href=\"https:\/\/litmus.com\/blog\/webmail-rendering-explained-why-preprocessors-are-the-enemy\">Mail clients use pre-processors<\/a> to remove potentially dangerous elements in the code before passing it on to the rendering engine. This can take out elements you&#8217;re using to render something accurately. <a href=\"https:\/\/litmus.com\/blog\/desktop-rendering-issues-focus-initial-testing-on-a-handful-of-rendering-engines\">Rendering engines<\/a> may also transform how the email looks, as each engine has different levels of support for HTML or CSS code.<\/p>\n<p>\nSome <a href=\"https:\/\/litmus.com\/blog\/mobile-email-how-devices-operating-systems-app-engines-affect-rendering\">webmail clients and apps<\/a> will also alter the code, adding their own classes and code into the email.  There are fixes that work around this, but you need to target the client specifically.<\/p>\n<p>\nAnd human error is always a possibility.  One character missing or out of place can break a whole email, and you&#8217;ll need to make certain you&#8217;re not missing tags, moving tags around, breaking links, or making mistakes in your code.<\/p>\n<h3>How you can fix some of these problems<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/designingemails-3-fixingproblems.png\" alt=\"Icons of a gear, a pen composing on a sheet of paper, and a code window\" width=\"600\" height=\"200\" class=\"aligncenter size-full wp-image-10312\" \/><\/p>\n<p>There are a few things you can do to help your emails render correctly.  They do require a bit more code, but a well-rendered email can make the difference between an engaged customer and an unsubscriber.<\/p>\n<h4>Create a pre-header<\/h4>\n<p>A pre-header is a short summary of the email&#8217;s contents that immediately follows the subject line.  <a href=\"https:\/\/litmus.com\/blog\/the-ultimate-guide-to-preview-text-support\">Preview text is pulled from the first few lines of text found within an email<\/a>, whether displayed or hidden, and by using a pre-header, you can include specific text without it actually being in the email.<\/p>\n<p>You can see what a pre-header will look like in Gmail and on an iPhone by <a href=\"https:\/\/codepen.io\/awoodall\/full\/XbpMbo\/\">checking XbpMbo<\/a>.<\/p>\n<p>To implement a hidden pre-header, add this code just underneath the body tag.<\/p>\n<p><code>&lt;!--[if !mso]&gt;&lt;!-- --&gt;<br \/>\n&lt;div style=\"display:none;width:0;max-height:0;max-width:0px;overflow:hidden;float:left;-mso-hide:all;font-size:1px;line-height:1px;opacity:0;color:transparent;height:0;width:0;visibility:hidden;\"&gt;<br \/>\nPreheader text goes here...<br \/>\n&lt;\/div&gt;<br \/>\n&lt;!--&lt;![endif]--&gt;<br \/><\/code><\/p>\n<h4>Add an Internet Explorer Meta Tag<\/h4>\n<p>You can enable CSS3 and media query support in Windows 7.5+, Live Mail, and the Windows 8 Mail app by using the <code>IE=edge<\/code> meta tag.  With this tag, Windows clients will render your CSS3 and media queries accurately.<\/p>\n<p>To prevent unwanted side effects in other email clients, enclose the tag in conditional comments and place it in the head of your HTML file.<\/p>\n<p><code>&lt;!--[if !mso]&gt;&lt;!-- --&gt;<br \/>\n&lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" \/&gt;<br \/>\n&lt;!--&lt;![endif]--&gt;<\/code><\/p>\n<h4>Make Gmail follow a specific width<\/h4>\n<p>The Gmail app shows the desktop version of your email, but doesn&#8217;t have support for embedded styles or media queries. It also doesn&#8217;t respect widths, meaning that everything will be moved around.<\/p>\n<p>For every container <code>&lt;table&gt;<\/code> or <code>&lt;td&gt;<\/code>, add this CSS element:<\/p>\n<p><code>min-width: 600px;<\/code><\/p>\n<p>This will force Gmail to keep it at the width you&#8217;ve designed for.<\/p>\n<h4>Force Outlook to pay attention to line height<\/h4>\n<p>If you have a specific line height in your CSS, some versions of Outlook will ignore this.  You can fix this by applying the code inline:<\/p>\n<p><code>&lt;td style=\"mso-line-height-rule:exactly; line-height: 18px;\"&gt;<\/code><\/p>\n<p>You need to make sure the line height is specified in pixels in order for it to render correctly.<\/p>\n<h4>Remove default link styles on iOS devices and Gmail<\/h4>\n<p>If you include an address, phone number, date, domain extension, or other word, Apple devices will often apply a blue colour to it to make it look like a link.  This can be frustrating, especially when it&#8217;s applied to domain extensions (for example, you&#8217;re telling everyone about how they can save on .com domains).  But by setting the correct style for the <code>appleLinks<\/code> style, you can fix this.<\/p>\n<p>For each item Apple would change, wrap it in a span like so:<\/p>\n<p><code>&lt;span class=\"appleLinks\"&gt;05551234567&lt;\/span&gt;<\/code><\/p>\n<p>Then add the following into your internal stylesheet:<\/p>\n<p><code>.appleLinks a {color: #000000!important; text-decoration: none!important;}<\/code><\/p>\n<p>This particular style would keep the text black and without an underline, but you can change it to match your body style.<\/p>\n<h3>And if you need help<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.heartinternet.uk\/blog\/wp-content\/uploads\/designingemails-3-resources.png\" alt=\"Icons of a laptop, links, and comments\" width=\"600\" height=\"200\" class=\"aligncenter size-full wp-image-10311\" \/><\/p>\n<p>There are some very useful sites out there that can help you. The ones I commonly use are:<\/p>\n<p><a href=\"https:\/\/labs.sign-up.to\/mally\/\">Mally from Sign-up.to<\/a> looks over your HTML code and finds any problems.  It can also put your CSS inline to make your email even easier to render across clients.<\/p>\n<p>FixMyHTML.com from Dancing Mammoth does exactly what it says \u2013 formats and fixes your HTML to make sure everything runs smoothly.<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/\">StackOverflow<\/a> and the <a href=\"https:\/\/www.emailonacid.com\/forum\">Email on Acid Forums<\/a> have other people who are happy to talk you through your problems \u2013 and it&#8217;s possible that someone else has already had the exact same problem and the answer is available through a quick search.<\/p>\n<p>And, finally, the <a href=\"https:\/\/validator.w3.org\/\">W3C Markup Validation Service<\/a> is there to check out your HTML and point out any serious problems. <\/p>\n<p>Here are some other resources that I&#8217;ve referred to over the years:<\/p>\n<h4>Templates and Email Builders<\/h4>\n<ul>\n<li><a href=\"https:\/\/foundation.zurb.com\/emails.html\">Foundation for Emails<\/a> \u2013 A HTML and CSS framework to produce responsive emails<\/li>\n<li><a href=\"https:\/\/www.inkbrush.com\/\">Inkbrush<\/a> \u2013 A web-based email design and coding tool<\/li>\n<li><a href=\"https:\/\/www.emailonacid.com\/blog\/email-development\/600_free_email_templates\">Email on Acid&#8217;s Email Template List<\/a> \u2013 A detailed list of over 600 free templates available<\/li>\n<li><a href=\"https:\/\/mailbuild.rookiewebstudio.com\/\">MailBuilds<\/a> \u2013 HTML email building software you can purchase<\/li>\n<\/ul>\n<h4>Resources<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.emailonacid.com\/blog\/email-development\/html_boilerplate\/\">Email on Acid&#8217;s Boilerplate<\/a> \u2013 A free and fully commented email boilerplate you can use to build your template upon<\/li>\n<li><a href=\"https:\/\/responsivedesign.is\/develop\/browser-feature-support\/media-queries-for-common-device-breakpoints\">Responsive Design.is&#8217;s Media Queries for Common Devices<\/a> \u2013 A lit of the media queries you should use when focusing on a particular browser<\/li>\n<li><a href=\"https:\/\/freepsdfiles.net\/graphics\/responsive-devices-psd-mockup\">FreePSDFiles&#8217; Responsive Devices PSD Mockup<\/a> \u2013 A PSD mockup of a desktop, laptop, tablet, and phone for testing out your initial email designs<\/li>\n<\/ul>\n<h4>Guides<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.email-standards.org\/\">Email Standards Project<\/a> \u2013 Runs through the different mail clients and gives you detailed reporting on how they work<\/li>\n<li><a href=\"https:\/\/templates.mailchimp.com\/concepts\/how-html-email-works\/\">MailChimp&#8217;s Guide to How HTML Email Works<\/a> \u2013 A detailed guide on HTML email<\/li>\n<li><a href=\"https:\/\/www.campaignmonitor.com\/css\/\">Campaign Monitor&#8217;s Ultimate Guide to CSS<\/a> \u2013 A breakdown of the CSS support for email clients<\/li>\n<li><a href=\"https:\/\/templates.mailchimp.com\/design\/typography\/\">MailChimp&#8217;s Guide to Typography<\/a> \u2013 A guide on font choices and CSS<\/li>\n<li><a href=\"https:\/\/litmus.com\/community\/learning\/8-outlook-overview\">Litmus&#8217;s Guide to Microsoft Outlook<\/a> \u2013 How to make your emails work in this popular mail client<\/li>\n<li><a href=\"https:\/\/backgrounds.cm\/\">Campaign Monitor&#8217;s Bulletproof Background Images<\/a> \u2013 How to get background images to work perfectly in your emails<\/li>\n<li><a href=\"https:\/\/litmus.com\/blog\/png-gif-or-jpeg-which-ones-should-you-use-in-email\">Litmus&#8217;s Image File Type Guide<\/a> \u2013 Listing which image file types are best for email<\/li>\n<li><a href=\"https:\/\/www.lynda.com\/HTML-tutorials\/Creating-Responsive-HTML-Email\/135374-2.html\">Lynda.com&#8217;s Course on Creating a Responsive HTML Email<\/a> \u2013 A paid course showing you how to create responsive emails<\/li>\n<li><a href=\"https:\/\/demand.eloqua.com\/LP=4763\">Oracle&#8217;s Email Design and Coding Recommendations<\/a> \u2013 A white paper on email design and coding<\/li>\n<\/ul>\n<h4>Testing<\/h4>\n<ul>\n<li><a href=\"https:\/\/putsmail.com\/\">PutsMail<\/a> \u2013 Litmus&#8217;s testing platform<\/li>\n<li><a href=\"https:\/\/www.emailonacid.com\/email-testing\/\">Email Testing<\/a> \u2013 Email on Acid&#8217;s testing platform<\/li>\n<li><a href=\"https:\/\/www.inboxinspector.com\/\">Inbox Inspector<\/a> \u2013 A free quick inbox testing platform<\/li>\n<li><a href=\"https:\/\/premailer.dialect.ca\/\">Premailer<\/a> \u2013 A pre-flight check for all your emails<\/li>\n<\/ul>\n<p>I hope that you&#8217;ve enjoyed this series on creating HTML emails, and that you&#8217;re making great emails now!<\/p>\n<p><small>Icons from the <a href=\"https:\/\/www.smashingmagazine.com\/2015\/01\/freebie-dashel-icon-set-svg-psd-png\/\">Dashel Icon Set by Print Express<\/a>.<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Each mail client is different, the slightest mistake can cause big problems, and it can be a bit of a mess when you\u2019re trying to debug everything. I\u2019m going to go over some of the more common fixes used.  These are what I use to make sure emails look right, and I hope they help you as well.<\/p>\n","protected":false},"author":2,"featured_media":9928,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-10309","post","type-post","status-publish","format-standard","has-post-thumbnail","category-web-design"],"_links":{"self":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/posts\/10309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/comments?post=10309"}],"version-history":[{"count":0,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/posts\/10309\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/media\/9928"}],"wp:attachment":[{"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/media?parent=10309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/categories?post=10309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.heartinternet.uk\/blog\/wp-json\/wp\/v2\/tags?post=10309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}