I'm building an email template under AMP4Email developer preview. I wonder if there is a way to make links dynamic in templates or via state.
<amp-list ...>
<template ...>
<a href="https://example.com/{{id}}"> <!-- not supported -->
...
</a>
</template>
</amp-list>
<a [href]="'https://example.com/' + state.id"> <!-- definitely not supported -->
...
</a>
So, I was wondering that from a list of items which are dynamically fetched from an API (hence the whole link is not pre-known), there is no way to give a link to each specific item with the help of data fetched? How does one navigate to such a URL?
Triaging to @choumx feel free to re-assign 馃槃
Templates in AMP4EMAIL are more constrained. You can have a dynamic href but the entire attribute value must be replaced:
<amp-list ...>
<template ...>
<a href="https://example.com/{{id}}"></a> <!-- not supported -->
<a href="{{url}}"></a> <!-- supported -->
</template>
</amp-list>
Hope that helps!
Thanks so much for the detailed description. That clears things up.
Most helpful comment
Templates in AMP4EMAIL are more constrained. You can have a dynamic
hrefbut the entire attribute value must be replaced:Hope that helps!