How to highlight email html text in Google Apps Sc

2019-08-29 09:46发布

问题:

I'm using a script to email a confirmation after a google form is filled out. I am using HTML in the email and want to highlight a few lines in yellow. I am using the code below but am receiving an error that the line is missing a ";" before the statement. Any ideas?

 + "<h2><b><span style="background-color:yellow;">Content</span></b></h2> " + "<br/>"

回答1:

You'll need to either escape your quotes with backslashes or use apostrophes instead for the HTML attributes.

Also, there's probably no reason to break out the <br> tag as you have.

+ "<h2><b><span style='background-color:yellow;'>Content</span></b></h2> <br/>"