Does dynamic Mandrill template support iteration over a collection?

marcelka picture marcelka · Sep 29, 2014 · Viewed 7.6k times · Source

I would like to add dynamic content to my e-mail, part of it being a collection of items (e.g. list of books). I would like Mandrill to render each of these items once (e.g. one table row per book). Is it possible to use for-loop in Mandrill somehow?

Answer

Anirvan picture Anirvan · Apr 30, 2015

Yes! Mandrill now offers full support for dynamic iteration over a list when you use the Handlebars templating language.

Here's how to do it: