emailtemplatessitecoresitecore8sitecore-exm

Sitecore 8 EXM: Create Custom Email Campaign


I am new to Sitecore. I am looking to create a custom email template for an email campaign. I am using Sitecore 8.1 with EXM 3.3. I Have been trying to implement the following walk-through:

Walkthrough: Building a custom message template

However, when I create a new email campaign with my new template, I am unable to assign components to the various placeholders on my aspx page. I have proved that the aspx file is the correct file in my Sitecore website by adding plain html to the file and seeing the results displayed in the body section of the message tab in the EXM application, as you can see from the following screen shot.

Edit Email Template

Below is the code for my Email Template:

<%@ Register TagPrefix="sc" Namespace="Sitecore.Web.UI.WebControls" Assembly="Sitecore.Kernel" %>
<%@ Register TagPrefix="sc" Namespace="Sitecore.Web.UI.WebControls" Assembly="Sitecore.Analytics" %>
<%@ OutputCache Location="None" VaryByParam="none" %>
<html>
    <head>
        <title>
            <!-- Used for storing title of the email -->
            <sc:Placeholder runat="server" Key="mn-title"/>
        </title>
        <!-- The VisitorIdentification control ensures that people viewing this page
        with a traditional web browser will be classified as humans not bots.
        This control is not required if people only view messages using Email clients -->
        <sc:VisitorIdentification runat="server" />
    </head>
    <body style="background-color:gold">
        <label>test html label added here!</label>
        <form method="post" runat="server" id="mainform">
            <table style="width:100%">
                <tr>
                    <td colspan="2" style="background-color:blue;color:green;width:100%">
                        <!-- Used for storing the title of the newsletter in h1 -->
                        <sc:Placeholder runat="server" Key="mn-header" />
                    </td>
                </tr>
                <tr>
                    <td style="background-color:white;color:black;width:100%">
                        <!-- Used for storing the content blocks of the newsletter in h2 and paragraphs -->
                        <sc:Placeholder runat="server" Key="mn-content" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="background-color:blue;color:green;width:100%">
                        <!-- Used for storing the footer e.g. the unsubscribe link -->
                        <sc:Placeholder runat="server" Key="mn-footer" />
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>

The html code contains the following placeholder keys:

When go to the Message tab for my email in EXM and choose the Add component button, I get the "Add Here" buttons on my page but am unable to choose any renderings to fit the mn-header and mn-footer components. The mn-content allows me to choose from several predefined renderings as seen in the screen shot below:

SelectRendering

Have I missed something important here? How can I select/choose what renderings are available for my placeholders?

The Walk-through contains five sections that need completing:

  1. Create a branch template

You can see from the following screen shot that this section is configured correctly:

CreateBranchTemplate

  1. Create template

You can see from the following screen shot that this section is configured correctly:

CreateTemplate

  1. Create the layout

You can see from the following screen shot that this section is configured correctly:

CreateTheLayout

  1. Bind the layout and the message template

I'm pretty sure that I have managed to complete the first 3 sections of the walk-through correctly but when I try to complete the section "Bind the Layout and the message template", point 5 of the walk-through says:

On the Controls tab, add the relevant controls. As a minimum add the following two controls:

  • Target Item – in /Renderings/Email Campaign.
  • Set Page Title – in /Renderings/Email Campaign.

But I don't have "Target Item" as an rendering to add in this case as you can see from the following screen shot:

SelectARendering

So I have added the following components in the Device Editor from the available renderings as seen in the following screen shot:

DeviceEditorControls

  1. Make your template available in EXM

You can see from the following screen shot that this section is configured correctly:

MakeMessageAvailableInEXM

Any Ideas what I am missing or doing wrong? Thanks in advance!


Solution

  • I think documentation for creating custom template is not yet updated for Sitecore EXM 3.3.

    I dont think Set Target Item is needed any more. I have installed sample newsletter package and I dont find it using that.

    Regarding your question.

    You need to create data source item and assign it to your control's data source property.

    I would suggest you to install sample newsletter package (came with default exm module package) and see it's structure and presentation details on Message root item. I have attached the one I have created. For your Scenario you need to create item under message root using "custom newsletter ll content" template and assign that item as a data source for Display body control.

    Hope this helps!

    Sample News Letter from Sitecore : No Target item present.

    Sample News Letter

    Newsletter item with datasource enter image description here

    Now go to presentation details of Root item and attach this data source to renderings enter image description here