onformsubmit不再工作了

时间:2013-09-19 21:17:47

标签: javascript

这允许用户填写表格以请求从我们的制作中心(复制中心)制作副本。表单会将所有问题和变量填入电子表格中。然后,它应该向表格中的原始请求者发送一封名为Production_center的帐户和一封确认电子邮件,请求者应该使用要复制的文档的PDF进行回复。这个脚本自3月以来一直在工作,突然间它无法工作。该表单可用并填写电子表格,但不会发送电子邮件。就像脚本脱离了表单一样。有什么想法吗?

function onFormSubmit(e) { 
 var timestamp = e.values[0]
 var submittedby = e.values[1]
 var dateneeded = e.values[2]
 var projecttitle = e.values[3]
 var name = e.values[4]
 var school = e.values[5]
 var dept = e.values[6]
 var email = e.values[7]
 var phone = e.values[8]
 var pagesoriginal = e.values[9]
 var numcopies = e.values[10]
 var papercolor = e.values[11]
 var duplex = e.values[12]
 var batch = e.values[13]
 var folding = e.values[14]
 var cut = e.values[15]
 var other = e.values[16]
 var cardstockcolor = e.values[18]
 var staple = e.values[19]
 var cover = e.values[20]
 var covercolor = e.values[21]
 var threeholepunch = e.values[22]

 try {
   var requisition = "Submitted by: "+submittedby+" at "+timestamp+"\r\r"+
     "Date Needed: "+dateneeded+"\r\r"+
     "Project Title: "+projecttitle+"\r\r"+
     "Name: "+name+"\r"+
     "School: "+school+"\r"+
     "Department: "+dept+"\r"+
     "Email: "+email+"\r"+
     "Phone: "+phone+"\r\r"+
     "ORIGINAL\r===========================\r"+
     "# of pages in original: "+pagesoriginal+"\r\r"+
     "COPIES\r===========================\r"+
     "# of copies: "+numcopies+"\r\r"+
     "Additional instructions:\r\r"+
     ""+other+"\r\r"+
     "Paper Color: "+papercolor+"\r\r"+
     "Card Stock: "+cardstockcolor+"\r\r"+
     "Single or Double-sided?: "+duplex+"\r\r"+
     "Batch or Collated?: "+batch+"\r\r"+
     "Staple?: "+staple+"\r\r"+
     "3-hole Punch?: "+threeholepunch+"\r"+
     "Folding?: "+folding+"\r"+
     "Cut?: "+cut+"\r\r"+
     "Cover?: "+cover+"\r"+ 
     "Cover Color: "+covercolor+"\r\r";
   var sendername = "Production Center Request";
   var subject = "Requisition Copy - "+dateneeded+" from "+name+"/"+school+"";
   var replytoaddress = "production_center@wellesley.k12.ma.us";
   MailApp.sendEmail("production_center@wellesley.k12.ma.us", subject, requisition, {name: sendername, replyTo: replytoaddress});


   var receiptsendername = "Production Center";
   var receipt = "Below is a confirmation receipt for your Production Center Request. Please verify that the information below is correct and reply to this email with your original attached as a PDF. Please make sure to include the full body of this email in your reply. If you are submitting your original in hard copy, please print this email and attach it to your original.\r\r"+
 requisition;
   var receiptsubject = dateneeded+" Production Requisition from "+name+"/"+school+"";
   MailApp.sendEmail(email, receiptsubject, receipt, {name: receiptsendername, replyTo: replytoaddress});

 }
 catch (e) {
    Logger.log( timestamp+"\t "+email+"\t "+name+"\t Status:"+e )   
 }
} 

0 个答案:

没有答案