sendgrid / email-templates

A repository of common email templates to use and modify to your heart's content.
https://sendgrid.com
MIT License
818 stars 987 forks source link

Math operations in Dynamic Email #82

Open jezmaghuyop opened 5 years ago

jezmaghuyop commented 5 years ago

Hi I'm very new to sendgrid's dynamic template and saw some samples that it is possible to use handlebars, my question is how do I do mathematical operations?

I have a list of Items that I need to add Quantity and Price to get the total price for each Item and I can't seem to find a way on how to do it. I saw some Helpers but I'm not sure how to actually implement and it where to put it.


Handlebars.registerHelper("multiply", function(a, b){
    return (a * b);
});
BoKKeR commented 3 years ago

I would also like to know if this is possible, a simple {{divide 100 variable}} would do it. But it does not seem to work

madmacc commented 2 years ago

I don't think this is possible with Sendgrid. It is possible in handlebars on other platforms though.

pepiyu commented 1 year ago

:( So sad