email-templates icon indicating copy to clipboard operation
email-templates copied to clipboard

Math operations in Dynamic Email

Open jezmaghuyop opened this issue 5 years ago • 3 comments

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);
});


jezmaghuyop avatar Jun 27 '19 13:06 jezmaghuyop

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

BoKKeR avatar Aug 19 '21 21:08 BoKKeR

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

madmacc avatar Oct 19 '21 05:10 madmacc

:( So sad

pepiyu avatar Jan 14 '23 10:01 pepiyu