我正在尝试从电子表格中的模板中更改一个单词,以获取用户通过输入框输入的值。当我运行我的脚本时,它不会改变这个词,有什么想法吗?
function sendEmails() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var time = Browser.inputBox("Enter TIME");
var address = "albdominguez25@gmail.com";
ss.setActiveSheet(ss.getSheetByName("Templates"));
var emailTemplate = ss.getRange("B1").getValue();
//here I am trying to replace the word "TIME" on my template to the value entered on the inputBox
emailTemplate.replace("TIME",time);
var emailSubject = "Tutorial: Simple Mail Merge";
MailApp.sendEmail(address, emailSubject, emailTemplate);
}