Right, this post is about “How to create a basic clean HTML for e-mail”.
First of, I expect that you have basic knowledge of HTML 4.0 Markup Language and knowledge of slicing a Photoshop template.
Secondly, I always create E-mails from scratch with a Text editor or Dreamweaver, never let Photoshop automatically create one HTML for you. My opinion is that if you do let Photoshop create HTML for you, you have less control over what you actually need or don’t need in the HTML itself.
So starting of, you most probably have designed a beautiful e-mail which you want to convert into HTML for e-mail. Look at your design in Photoshop and check if background images aren’t mixed with fonts which you want to keep as a text selection in HTML.
If you spotted any, then find an alternative solution because background images aren’t supported in all e-mailclients.
An e-mail template consist’s of mainly 3 parts:
a header, a body and a footer.
- In the header you put information like “weblink version”, “Why your customers received the e-mail” and maybe a “Snippet”.
- In the body you place your content, your message to your customers. Be clear (short) and write specific towards your customers.
- In the footer you’ll put information about privacy policy, disclaimer, copyright, unsubscribtion, adress, company business information, chamber of commerce number, white-labeling your e-mailadres.
Keeping the above in mind, I’m going to explain an basic HTML template which contains just these 3 parts.
An e-mailtemplate is always build up in a table construction. With table tags you have 100% control of each design element you just sliced and saved in the images folder. So counting for top to bottom you would have 3 rows for each part.
This means you will need at least 3x <tr><td></td></tr> within your table tag. Something like this:
<table>
<tr><td>header</td></tr>
<tr><td>body</td></tr>
<tr><td>footer</td></tr>
</table>
Then you give your “table” the exact “width” of your widest width in your design. Usually you create an e-maildesign of maximum 750 pixels wide. Then you keep the value of the “borders” zero so you have no unwanted spaces. Everything needs to be tight connected. The same you will need to do for the “spacing” and “padding”. And I will already fill in the header and footer text.
Also you want to center your table otherwise it will standard align to the left and looks ackward in Hotmail or Gmail.
Your new code will look like:
<table width=“750” cellspacing=“0” cellpadding=“0” border=“0” align=“center”>
<tr><td align=“center”>This e-mail was send to example@example.com. Can’t see the images properly? <a href=”#URL_WEBLINK” title=“Click here” target=“_blank”>Click here!</a></td></tr>
<tr><td></td></tr>
<tr><td align=“center”>
Copyright 2010 © | <a href=”#URL_TO_UNSUB_FORM” title=“unsubscribe” target=“_blank”>Unsubscribe here</a>
</td></tr>
</table>
Then you will insert the images to their designated place. Let’s say you have only one image in the content area in the body and that your e-mail design was blue and a white font. The image needs to be aligned right.
Your new code is:
<table width=“750” cellspacing=“0” cellpadding=“0” border=“0” bgcolor=“blue” style=“color:white;” align=“center”>
<tr><td align=“center”>This e-mail was send to example@example.com. Can’t see the images properly? <a href=”#URL_WEBLINK” title=“Click here” target=“_blank”>Click here!</a>
<tr><td>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tincidunt porttitor molestie. Mauris eu laoreet lorem. <img src=”#URL_TO_IMAGE” alt=“example” width=“50” height=“50” border=“0” align=“right” vspace=“10” hspace=“10” /> Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis nibh metus, euismod a elementum eget, varius ut nunc. Morbi eu est diam, a ultricies nunc. Nunc consequat ornare metus nec pulvinar.</td></tr>
<tr><td>
Copyright 2011 © | <a href=”#URL_TO_UNSUB_FORM” title=“Unsubscribe” target=“_blank”>Unsubscribe here</a></td></tr>
</table>