pariser
pariser

Reputation: 275

Showing / Hiding Mandrill mc:hideable fields via the message API

Mandrill allows you to attach the mc:hideable attribute on an element in HTML email, as in

<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>

With this example template, using the mc:edit="name" attribute, I can change the content in "section_2" very easily by editing the "template_content" field via the messages API, as in:

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

Is there a way to hide the content in "section_1"? It seems like this should be easy.

Upvotes: 2

Views: 2059

Answers (1)

Kaitlin
Kaitlin

Reputation: 6235

Mandrill currently supports a subset of the MailChimp template language (specifically regions with mc:edit attributes). While it's possible to have the mc:hideable attribute and it won't cause errors in using the template, Mandrill doesn't yet support hiding those elements when sending the email. The same goes for other MailChimp template language attributes, like mc:repeatable and editable image areas - they won't break, but replacing them isn't currently possible in the send-template API call.

More information about using templates with Mandrill can be found here: http://help.mandrill.com/forums/20689686-Templates-and-Dynamic-Content

Upvotes: 1

Related Questions