如何在Google Apps脚本中突出显示电子邮件html文本? [英] How to highlight email html text in Google Apps Script?

查看:76
本文介绍了如何在Google Apps脚本中突出显示电子邮件html文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在填写Google表单后,我正在使用脚本通过电子邮件发送确认邮件.我在电子邮件中使用HTML,并希望用黄色突出显示几行.我正在使用下面的代码,但收到错误,该行缺少;"在声明之前.有什么想法吗?

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/>"

推荐答案

您将需要使用反斜杠对引号进行转义,或者对HTML属性使用撇号.

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

此外,可能没有理由像您一样使用<br>标记.

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/>"

这篇关于如何在Google Apps脚本中突出显示电子邮件html文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆