Is there a way to define a Handlebars user helper with Mandrill? Let's say that I have an object, and the currency is in cents.
"products": [ { "sku": "hdrPhotos", "price": 19000, "title": "Unlimited HDR Photography" }, { "sku": "panos", "price": 2500, "title": "Panoramas / Virtuals" }, { "sku": "fullVideo", "price": 43000, "title": "Full Video" }, { "sku": "aerialDaytimePhotos", "price": 17500, "title": "Aerial Daytime Photography" }, ]
I have this template:
{{#each products}} <tr class="item"> <td valign="top" class="textContent"> <h4 class="itemName">{{title}}</h4> <span class="contentSecondary">${{toCurrency price}}</span> <br/> <span class="contentSecondary sku"><em>{{sku}}</em></span> <br/> </td> </tr> {{/each}}
I want to take price
, which is in cents, and write my own toCurrency
helper, which simply divides it by 100.
User assistants are easy enough for regular pens, but is this possible using Mandrill?
source share