【问题标题】:Showing / Hiding Mandrill mc:hideable fields via the message API通过消息 API 显示/隐藏 Mandrill mc:hideable 字段
【发布时间】:2013-01-13 17:27:46
【问题描述】:

Mandrill 允许您在 HTML 电子邮件中的元素上附加 mc:hideable 属性,如

<p mc:edit="section_1" mc:hideable>
  Content that I only want to show on some emails.
  <a href="http://link.to/do/something">
    Because it has a link that only applies sometimes
  </a>
</p>

<p mc:edit="section_2">
  Variable content that I want to show every time.
</p>

使用这个示例模板,使用 mc:edit="name" 属性,我可以通过消息 API 编辑“template_content”字段,非常轻松地更改“section_2”中的内容,如下所示:

"template_content": [{"name": "section_2", "content": "Some content"}]

有没有办法隐藏“section_1”中的内容?看起来这应该很容易。

【问题讨论】:

    标签: html-email mailchimp transactional-email


    【解决方案1】:

    Mandrill 当前支持 MailChimp 模板语言的子集(特别是具有 mc:edit 属性的区域)。虽然可能有 mc:hideable 属性并且在使用模板时不会导致错误,但 Mandrill 尚不支持在发送电子邮件时隐藏这些元素。其他 MailChimp 模板语言属性也是如此,例如 mc:repeatable 和可编辑图像区域 - 它们不会损坏,但目前无法在 send-template API 调用中替换它们。

    更多关于在 Mandrill 中使用模板的信息可以在这里找到:http://help.mandrill.com/forums/20689686-Templates-and-Dynamic-Content

    【讨论】:

    • 谢谢 -- 你知道 Mandrill 是否/何时会添加对 mc:hideable 字段的支持吗?
    • 我目前没有模板更改的预计到达时间。不过,我可以说,模板的更新和改进已在路线图中。
    猜你喜欢
    • 1970-01-01
    • 2013-05-30
    • 2013-07-12
    • 1970-01-01
    • 2013-08-18
    • 1970-01-01
    • 2013-03-08
    • 2018-07-06
    • 2023-04-03
    相关资源
    最近更新 更多