Accelerate Your Workflow with Modular Email Design
Modular design can be applied to email development to create a flexible framework of pre-tested code blocks or "partials" that you can mix and match for any email. A partial is a self-contained code sample that can be used in any order within the flow of an email. Instead of custom coding each email template and maintaining them separately, keep a library of tested code blocks that can be used to assemble any design your company or department might need. I'll be going over how to build the "frame" you'll drop your partials into, how to select the partials you'll need, and how to maintain the library of partials as you test and iterate.
Building the Frame
The frame contains a few elements that are required for all emails:- Doctype
- HTML tag
- Head tags
- Meta tags
- Style block
- Body tags
- Container table
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
<style type="text/css">
</style>
</head>
<body style="Margin:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;min-width:100%;background-color:#ffffff;" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- Email Content Here -->
</table>
</body>
</html>
Now you'll want to build partials that you can drop into the frame. At this point, you need to decide if your partials will be stacking tables inside the container table, or stacking TRs. The TR stacking method may be preferable, because it makes full-width colored backgrounds easier. The examples below show these two methods.
With a table for each partial.
<body style="Margin:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;min-width:100%;background-color:#ffffff;" >
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>
<!-- Start Partial 1 -->
<table>
<tr>
<td>
</td>
</tr>
</table>
<!-- End Partial 1 -->
<!-- Start Partial 2 -->
<table>
<tr>
<td>
</td>
</tr>
</table>
<!-- End Partial 2 -->
</td>
</tr>
</table>
</body>
With a row for each partial.
<body style="Margin:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;min-width:100%;background-color:#ffffff;" >
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<!-- Start Partial 1 -->
<tr>
<td>
</td>
</tr>
<!-- End Partial 1 -->
<!-- Start Partial 2 -->
<tr>
<td>
</td>
</tr>
<!-- End Partial 2 -->
</table>
</body>
Of course these are not the only ways to build a frame and include partials in it. You may want to experiment and find what works best for you!
Creating a Library of Partials
Each partial that will serve as a content block should have the same structure. As we described above, that may be starting and ending with table tags, or starting and ending with TR tags. By constructing them in the same manner, the partials are interchangeable and can be used to construct emails in any order. You'll want to start by taking an inventory of the needs of your department or company. Most will need at least a few basics:- A header with logo
- A full-width hero image
- A full width, single column article
- An article with image left(or right) and text on the other side
- A left aligned button, a centered button, a big button
- A footer with address, unsubscribe, and so on