Creating a Handlebars Special Assistant with Mandrill?

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:

  <!-- BEGIN PRODUCT LOOP // --> {{#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?

+5
source share
1 answer

According to the documentation, this is not possible:

"Use Handlebars regardless of whether you use templates in Mandrill. We'll look at the basics of Handlebars, helpers implemented specifically for Mandrill, as well as some deviations from standard handles and adding to them."

Link: https://mandrill.zendesk.com/hc/en-us/articles/205582537-Using-Handlebars-for-Dynamic-Content#using-helpers

There are not even all steering assistants.

0
source

Source: https://habr.com/ru/post/1243908/


All Articles