自动确认电子邮件未使用触发器"在表单提交上发送"

时间:2015-02-19 21:08:14

标签: javascript forms email

我刚创建了一个新的Google表单,并希望在提交表单时自动发送确认电子邮件。基本上,学术部门使用该表格批准或拒绝学生的转学分,然后自动发送电子邮件确认给学生,以便他/她知道决定而无需单独联系学生。

我之前用大约5个月之前的两种不同形式做过这件事,从来没有遇到过问题。但是使用我刚创建的这个新表单,电子邮件无效。它似乎在昨天工作,但我今天无法重新创建成功的电子邮件确认。我已经浏览了留言板,但没有找到同样的问题。

我正在使用脚本编辑器并在表单提交上创建触发器""我开始使用我知道的其他表单的代码,只是更改了值和消息。我的脚本看起来像这样:

function myFunction(e) {

  var UserName = e.values[1];  
  var LastName = e.values[2];  
  var FirstName = e.values[3];  
  var SAGEID = e.values[4];  
  var UserEmail = e.values[5];  
  var Dept = e.values[6];  
  var Coll1 = e.values[11];  
  var Course1 = e.values[12];  
  var Req1 = e.values[13];  
  var Decision1 = e.values[14];  
  var Coll2 = e.values[15];  
  var Course2 = e.values[16];  
  var Req2 = e.values[17];  
  var Decision2 = e.values[18];  
  var Coll3 = e.values[19]  
  var Course3 = e.values[20];  
  var Req3 = e.values[21];  
  var Decision3 = e.values[22];  
  var Coll4 = e.values[23];  
  var Course4 = e.values[24];  
  var Req4 = e.values[25];  
  var Decision4 = e.values[26];  
  var Notes = e.values[9];  

  var Subject = "Course Equivalency Request Decision - " + FirstName + " " + LastName + " (" + Dept + ")";  
  var Message = "The " + Dept + " department has made a decision regarding your course equivalency request. Any questions regarding the decision below should be directed to the " + Dept + " department. " +  

 "\n\n\nDepartment Comments: " + Notes + 
 "\n\nCourse 1: " + Coll1 + ": " + Course1 + "\nDecision: " + Decision1 +    "\nRequirement: " + Req1 +  
 "\n\nCourse 2: " + Coll2 + ": " + Course2 + "\nDecision: " + Decision2 + 
 "\nRequirement: " + Req2 + 
 "\n\nCourse 3: " + Coll3 + ": " + Course3 + "\nDecision: " + Decision3 + 
 "\nRequirement: " + Req3 + 
 "\n\nCourse 4: " + Coll4 + ": " + Course4 + "\nDecision: " + Decision4 + 
 "\nRequirement: " + Req4 + 

 "\n\n\nPlease allow 3-4 business days for processing.  If after 3-4 business days, your undergraduate degree audit does not reflect these substitutions, please contact the Office of the University Registrar at registrar@brandeis.edu or 781-736-2010." + 

 MailApp.sendEmail(UserEmail, Subject, Message);



}

我试着弄清楚为什么这个剧本的版本能够以不同的形式很好地运作,但我现在不能为我工作。我编写Google脚本相对较新,因此非常感谢您提供的任何帮助。

0 个答案:

没有答案