我如何读取应用程序脚本项目中的另一个文件?

How do i read another file inside the app script project?

我的项目中有这个 email_template.html 文件,但我不知道如何访问它。我想将内容作为字符串读取,以便我可以对其进行解析。

你可以得到 html 作为这样的字符串:

const template = HtmlService.createTemplateFromFile("email_template");
const htmlOutput = template.evaluate();
const contentString = htmlOutput.getContent();
Logger.log(contentString);

然后就可以解析contentString了。