I have created this script that allows me to select a certain food item and the serving size and then it calculates nutritional value, adds it to a database, sums it all at the
The HTML must be a string (text), and you need to build the HTML with a text formula. Text strings in JavaScript are put together, (concatenated) with a plus sign:
var tableHTML = '' + //Note single quotes on ends
"Calories " +
calories +
" " +
"Calories From Fat " +
caloriesFromFat +
" " +
"PolyUnsaturated " +
polyFat +
" " +
"
";
If double quotes are used in the HTML attribute, then use single quotes on the ends of the string. Then just use the variable name for the email HTML:
htmlBody: tableHTML