I am trying to run the script above. I have a google spreadsheet that I included a Menu to. I want to be able to have a template ready to be sent when any of the options under the Menu, Email List, are clicked. I am new to this and I am trying to run the script below but I am getting an error. I am attaching the script. Could anyone help me understand what is the problem here?
function onOpen() {
var subMenus = [{name:"Title 1", functionName: "t1"},
{name:"Title2", functionName: "t2"},
SpreadsheetApp.getActiveSpreadsheet().addMenu("Email List", subMenus);
}
function t1() {
var address = "test@test.com"
var body = "Dear Employee," +
"Today You didnt request your logon time" +
"Sincerely,"
"Your Name"
"Thank you";
MailApp.sendEmail(address,body);
}
There’s a lot of basic syntax errors on your code, the script editor does not even allow it be saved. But the only “logic” problem I saw in it, is that you forgot the
subjectparameter on theMailApp.sendEmailcall. Here is the fixed code: