'How to make a simple calculation in HTML?

Good evening everyone,

I am trying to make an html email using a CRM that has a total price which i get from {total_price} and a deposit 50% of the total price. As there is no {deposit} in the CRM i am using , i though i would make a simple calculation

<!DOCTYPE html>

<html>
<p id="deposit"></p>
<script>

var x={total_price};
var y=0.5;
var  z=x*y;

document.getElementById("deposit").innerHTML = "Deposit : " + z + "€";
</script>

But my CRM doesn't seem to be able to handle JS, is there any other way to have the same result?



Solution 1:[1]

Unfortunately, no way. HTML is a markup language, it has no processor powers, at all. That's why javascript came into the browsers. And modern email clients doesn't support javascript.

Your CRM could have some custom proprietary variables or customization for HTML, that should be processed before sending the email. It's a nice feature to have on a CRM.

There is more here about JavaScript on email.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1