On Github jennz0r / 2000
Civil Engineer
Once upon a time, I was civil engineer!But I quickly became bored with the slow pace of projects."Community Specialist" at "Startup"
Read: customer support.
I wanted to be part of the Tech industry, so I started working as a "Community Specialist" for a "startup".So I taught myself to code.
I landed my first job as a Web Developer!
Redesign emails and make them mobile-friendly.
The first victim was our Welcome email.
Naturally, I researched other Welcome emails.
Signed up for services and scoured my personal email for examples of good and/or bad email designs.A lot of it is pretty instinctual, but eventually I could pinpoint the highs and lows.I know, I know, these are not welcome emails.
But they're just so pretty!
May not work for everyone
A/B Test the hell out of your emails
Testing the mobile waters
Reliable rendering across clients and devices
Teams with limited resources
Simple layouts
Emails with mostly text that can flow
Teams with limited resources
Large mobile audiences
The most control over layout
Teams with knowledge of media queries
We used them all.
There are a LOT of options...
which I'll mention a bit later
... and which I didn't use.
Minimum Touchable Area44px by 44px
Smashing Magazine: Touchscreen Target Sizes
Puget Works: Minimum Touchable Areas
Velocity vs JavaServer Page (JSP)
are coming.
Not adding an outer <table> makes your code disappear in Apple Mail and Outlook 2011
do not display as inline or block
<table> default is display:table;
Use display:block; or Chrome will ignore max-width!
Gmail doesn't support <style> in <head>
Outlook.com doesn't support link in <head>
Many clients don't support a whole bevy of CSS!
See Campaign Monitor CSS page.
You will, unfortunately, be doing a lot of this:
From: ${userName} <${userEmail}>
<%--Wrapper Table Begin--%> <%--Wrapper Table End--%>
Tables all the way down.
Always have alt=" " or a background color.
This is also great for accessibility!
Check it out on Github
Awesome for readability or targetting devices!
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { #backgroundTable { max-width: 600px; } }
Note: Media queries don't work on all clients.
Style Campaign's Guide to Responsive Email Support
Target Apple devices with 480px
@media only screen and (max-width: 480px), (max-device-width: 480px) { // Small screen styles here }
Use in conjunction with fluid layouts (% based widths)
@media only screen and (max-width: 480px), (max-device-width: 480px) { #backgroundTable { max-width: 480px; font-size: 18px; margin: 0px; } }
From Stack Overflow
Target retina or high res devices
@media all and (min-device-pixel-ratio : 1.5), all and (-webkit-min-device-pixel-ratio: 1.5) { // Retina device styles go here! }
When to use?
Sometimes inline styles overwrite media queries...
@media only screen and (max-width: 480px), (max-device-width: 480px) { .headerBar { height: 5px !important; line-height: 5px !important; } }
Blah blah blah
Set a line-height on the surrounding <td>
Super weird and only occurs occasionally.
VS.
Outlook 2007, 2010, 2013, and Outlook in IE don't allow HTML or CSS image sizing. Argh.
Replace <img> by setting a background-image style on the surrounding <td> and assigning display: none; on the <img>.
@media all and (min-device-pixel-ratio : 1.5), all and (-webkit-min-device-pixel-ratio: 1.5) { td[class="cautionBar"] { background-image: url('http://filenet.hotpads.com/images/email/warning.png'); background-position: center; background-size: 30px 30px; background-repeat: no-repeat; width: 30px; !important; height: 30px; !important; } td[class="cautionBar"] img { display: none; } }
ignore max-width.
#backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { #backgroundTable { width: 600px; } }
Style Campaign Max Width Bypass
Ignores <a> color styles in the <head>.
You have to style each and every <a> inline.