简体   繁体   中英

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

I have this email_template.html file in my project and I don't know how to access it. I want to read the content as a string so that I can parse it.

在此处输入图像描述

you can get html as string like this:

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

Then you can parse contentString.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM