Link to Gsheet (refer Cols G-H) -
CodePudding user response:
In Code.gs, replace all \n
newline characters in row[name1]
to <br>
:
data.forEach(function(row){
// Add this line:
row[name1] = row[name1].replace(/\n/g, "<br>")
emailTemp.level2names = row[name1];
var htmlMessage = emailTemp.evaluate().getContent();
GmailApp.sendEmail(
row[name1],
"Trial Output!",
"Your email doesnt support HTML",
{name: "Vish", htmlBody: htmlMessage}
);
});
And change your scriptlet type to force printing:
<!-- Add the ! character after the ? -->
<?!= level2names?>