我已經查看了很多資源以找出我的腳本出了什麼問題,但沒有任何工作。我正在嘗試在Google表單提交後發送確認電子郵件。好像我的腳本沒有從表單中正確地調用電子郵件地址。
我原來的腳本來自http://acrl.ala.org/techconnect/?p=2343,我修改了我的表單。
這是它看起來像:提交Google表單後發送確認電子郵件
function swykemailconfirm(e) {
var userEmail = e.values[10]; //email from column K
var firstName = e.values[2]; //first name from column C
var lastName = e.values[1]; //last name from column B
var test = e.values[4]; //test name from column E
MailApp.sendEmail(userEmail,
"Thank you " +firstName + lastName + "for signing up to take the " + test + "Show What You Know test. " +
"Make sure you see Ms. May to get your pass. " +
"See you on Thursday in room 32 at 3:30." +
"The Math Department");
}
我做一個測試表單提交後收到此錯誤消息的電子郵件: 找不到方法(類)sendEmail(字符串,字符串)。 (6號線,文件「守則」)
搜索這裏Google Forms Confirmation Script一種方式來編輯我的劇本後,我用的建議之一,改變了我的代碼如下:
function swykemailconfirm(e) {
var userEmail = e.values["E-mail"][0];
var firstName = e.values[2];
var lastName = e.values[1];
var test = e.values[4];
MailApp.sendEmail(userEmail,
"Thank you " +firstName + lastName + "for signing up to take the " + test + "Show What You Know test. " +
"Make sure you see Ms. May to get your pass. " +
"See you on Thursday in room 32 at 3:30." +
"The Math Department");
}
我正在一個在提交測試表單後提交此錯誤消息的電子郵件: TypeError:無法從undefined讀取屬性「0」。 (第2行,文件「代碼」)
任何幫助非常感謝!