使用Oracle Responsys从电子邮件中的字符串渲染HTML

问题描述

我正在通过将字符串传递给responsys来呈现html。

DynamicVariable.TEXT将是一个类似于以下内容的字符串:

<button style="background-color: red; color: white; padding: 25px; border-radius: 4px; border: none; font-size: 18px; font-weight: bold">
  Click Here
</button>

我尝试使用?html

<body bgcolor="white" style="margin: 0px; padding: 0px;">
  ${DynamicVariable.TEXT?html}
</body>

还尝试了:

<body bgcolor="white" style="margin: 0px; padding: 0px;">
  <#escape x as x?html>
    <#noescape>${DynamicVariable.TEXT}</#noescape>
  </#escape>
</body>

以及

<body bgcolor="white" style="margin: 0px; padding: 0px;">
  <#noescape>${DynamicVariable.TEXT}</#noescape>
</body>

但是这些都不起作用。任何帮助将不胜感激!

解决方法

我找到了答案。

使用是正确的。但是,代码未呈现,因为您需要利用Responsys内容库中保存的文档。

<body bgcolor="white" style="margin: 0px; padding: 0px;">
  <#noescape>${DynamicVariable.TEXT}</#noescape>
</body>