Thursday, December 17, 2015

Sitecore walkthrough of Email Experience Manager templates

Templates for Sitecore's Email Experience Manager (EXM) are a different process than a standard page layout. However once implemented they have the standard placeholder which can then hold sublayouts/renderings which can then use your existing controls and data!

One note is that email HTML generally has some different requirements than a standard page to ensure it loads correctly in all mail clients (outlook for example). You will need to do some research, but generally all css classes should be inline (not external files) and you should use tables over div elements...

In the default instance of the Email Experience Manager, a template called One-column message is available.


Visually, this layout has two sections available for content entry; main content and footer.


This email template is configured in the content tree at: /sitecore/templates/Branches/Email Campaign/Messages/One-Column Message.


It has five elements, which together make up the email template.

  • One-column message: is a branch template - which in Sitecore allows you to create a set of items rather than a single item.
  • $name: is an AB Test Message template - has the general settings of the email message (such as from name/email, attachments, default include/exclude recipient lists and so on.
  • Message Root: of template message root - is where the layouts and sublayouts are set. 
    • The layout will link to a standard Sitecore layout file (which should of course have HTML optimized for email clients). As shown below, you use placeholders as you would for web layouts.
    • Target item should be the first control in the list and will be used for personalisation. Set Page Title will set the title of the message. Display Body and Display Footer are used to place the content into the pre-defined areas and Process Personalization Tokens (which should appear last in the list) will replace the tokens (first name for example) with the user's detail.
  • Content and Footer: are both custom data templates which are then accessed by the display body and display footer renderings to populate the email. In this case they simply output the text, however you can use tokens and even more complex business logic.

Adding the template to the Email Experience Manager

If you create a custom email template to get it to appear as an option in EXM, you will need to complete the following steps.
  1. For a one time message, navigate to the /sitecore/content/Email Campaign/Message Types/OneTime/Default item.
  2. On the configure menu select assign (insert options)
  3. Here you can modify which templates can be used for email campaign for the given message type.

No comments:

Post a Comment