我正在尝试制作一个简单的脚本,向通过 Google 表单填写调查的用户发送电子邮件。
他们将进行调查,答案记录在电子表格中,此脚本将通过电子邮件向他们发送问题的副本(标题)以及他们的答案(应该是表格的最后一行。)
它发送到的电子邮件将是最后一列,不包含在电子邮件中。
这是我正在编写的脚本:
function sendFormByEmail(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getActiveSheet();
var emailSubject = "EMAIL-SUBJECT-HERE";
var yourEmail = "CURRENTLY-JUST-A-STATIC-EMAIL-ADDRESS"; //get this from a field.value then just cut off that field from being included in the email (just do column-1)...
var headers = headersRange.getValues()[0]; //google api to get the header values.
var lastRow = s.getLastRow();
var message += headers.toString();
message += (headersRange.getValue()[last]).toString(); //should get the last row of data?
MailApp.sendEmail(yourEmail, emailSubject, message);
}