You are here:
Appendix: Use GTL with AMP for Email Mustache Syntax
Guide Template Language and AMP Mustache templates use the same delimiters (double curly braces {{ and }}). Therefore, when sending AMP containing Mustache templates through Marketing Cloud Engagement, ensure that you add a snippet of code at the top to change the GTL delimiters.
The <!-- {{={< >}=}} --> snippet changes the
delimiters from {{variable}} to {<variable>}
Code Sample
You can send this code example in Marketing Cloud Engagement to see how the delimiter change works. To see what happens when you don’t account for the delimiter conflict, remove the delimiter change.
<!-- {{={< >}=}} -->
<!doctype html>
<html ⚡4email>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
<style amp4email-boilerplate>body{visibility:hidden}</style>
</head>
<body>
Check out these latest deals from our store!
<amp-list src="https://amp.dev/static/samples/json/cart.json" layout="fixed-height" height="80">
<template type="amp-mustache">
<div id="cart">
<!-- These items (and their prices) can be updated dynamically. -->
{{#cart_items}}
<div class="cart-item">
<span>{{name}}</span>
<span>{{price}}</span>
</div>
{{/cart_items}}
{{^cart_items}}
There are no featured products available. Please check back again later.
{{/cart_items}}
</div>
</template>
</amp-list>
</body>
</html>

