Best Practices for Email Templates
- Topics:
- Administering
CREATED FOR:
- Admin
This document describes some of the best practices around email design resulting in a well-developed email campaign template.
The demo campaign available in AEM follows all of these best practices. How the best practices are implemented in the demo campaign is described for each best practice.
Use these best practices when creating your own newsletter.
master
page of type cq/personalization/components/ambitpage
. For example if you are planning a campaign structure is something like:/content/campaigns/teasers/en/campaign-promotion-global
/content/campaigns/teasers/master/en/campaign-promotion-global
Template/page component
/libs/mcm/campaign/components/campaign_newsletterpage
Specify document type to ensure consistent rendering.
Add DOCTYPE at the beginning (HTML or XHTML)
Is configurable by design changing the cq:doctype property in "/etc/designs/default/jcr:content/campaign_newsletterpage"
The default is "XHTML":
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Can be changed to "HTML_5":
<!DOCTYPE HTML>
Specify character definition to ensure correct rendering of special characters.
Add CHARSET declaration (e.g. iso-8859-15, UTF-8) to <head>
Is set to UTF-8.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Code all structure using the <table>element. For more complicated layouts, you should nest tables to build complex structures.
Email should look good even without css.
Tables are used throughout the whole template for structuring content. Currently using a maximum of four nested tables (1 base table + max. 3 nesting levels)
<div> tags are only used in author mode to ensure proper component editing.
All tables contain necessary attributes like border, cellpadding, cellspacing and width.
To harmonize element positioning inside tables, all table cells have the attribute valign="top" being set.
Account for mobile-friendliness, if possible. Use media queries to increase text sizes on small screens, provide thumb-sized hit areas for links.
Make an email responsive if the design allows for it.
To better demonstrate the underlying HTML structure and ease the possibility to customize the newsletter structure only some CSS definitions have been inlined.
Base styles and template variations have been extracted to a style block in the <head> of the page. On final submission of the newsletter these CSS definitions should be inlined into the HTML. An automatic inlinening mechansim is planned, but currently not available.
Images
/libs/mcm/campaign/components/image
<img>
element instead of background images in a table.Text and Links
/libs/mcm/campaign/components/heading, /libs/mcm/campaign/components/textimage
Depends on newsletter design.
For the demo design the font "Helvetica" is used, but will fall back to generic sans-serif font, if not present.
Generic
<html>
element is missing.Campaign newsletter templates and examples
AEM comes with several templates and components out of the box for you to create campaign newsletters. You can use these templates and components to create your custom newsletters.
Templates
To offer a solid base and to broaden the variety of content flow possibilities, there are three slightly different template types available out of the box. You can easily use these to build a custom newletter.
All have a header, a footer and a body section. Below the body section, each template differs in column design (1, 2 or 3 columns).
Components
There are currently seven components available for use inside campaign templates. These components are all based on the Adobe markup language HTL.
These components are described in detail in Adobe Campaign components.