【发布时间】:2016-09-13 11:42:42
【问题描述】:
我是 Sitecore 的新手。我正在寻找为电子邮件活动创建自定义电子邮件模板。我正在使用带有 EXM 3.3 的 Sitecore 8.1。我一直在尝试实施以下演练:
Walkthrough: Building a custom message template
但是,当我使用新模板创建新的电子邮件营销活动时,我无法将组件分配给我的 aspx 页面上的各种占位符。我已经证明了我的 Sitecore 网站中的 aspx 文件是正确的文件,方法是在文件中添加纯 html 并查看 EXM 应用程序中消息选项卡的正文部分中显示的结果,如下面的屏幕截图所示。
以下是我的电子邮件模板的代码:
<%@ 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>
html 代码包含以下占位符键:
<sc:Placeholder runat="server" Key="mn-title" /><sc:Placeholder runat="server" Key="mn-header" /><sc:Placeholder runat="server" Key="mn-content" /><sc:Placeholder runat="server" Key="mn-footer" />
当在 EXM 中转到我的电子邮件的“消息”选项卡并选择“添加组件”按钮时,我的页面上出现了“在此处添加”按钮,但无法选择任何渲染以适合 mn-header 和 mn-footer 组件. mn-content 允许我从几个预定义的渲染中进行选择,如下面的屏幕截图所示:
我在这里错过了一些重要的事情吗?如何选择/选择可用于占位符的渲染?
演练包含五个需要完成的部分:
- 创建分支模板
您可以从以下屏幕截图中看到此部分配置正确:
- 创建模板
您可以从以下屏幕截图中看到此部分配置正确:
- 创建布局
您可以从以下屏幕截图中看到此部分配置正确:
- 绑定布局和消息模板
我很确定我已经成功完成了演练的前 3 个部分,但是当我尝试完成“绑定布局和消息模板”部分时,演练的第 5 点说:
在“控件”选项卡上,添加相关控件。至少添加以下两个控件:
- 目标项目 - 在 /Renderings/Email 广告系列中。
- 设置页面标题 - 在 /Renderings/Email 广告系列中。
但在这种情况下,我没有“目标项目”作为要添加的渲染,您可以从以下屏幕截图中看到:
所以我在设备编辑器中从可用的渲染中添加了以下组件,如以下屏幕截图所示:
- 使您的模板在 EXM 中可用
您可以从以下屏幕截图中看到此部分配置正确:
任何想法我错过了什么或做错了什么?提前致谢!
【问题讨论】:
标签: email templates sitecore sitecore8 sitecore-exm