title: google script email form accept/reject
body: <p>I wrote some macro code to send an email to a manager based on form submissions (to be used in a expense/approval process), this is my first project using google forms/spreadsheets so maybe i might be missing something simple, but i looked through 2 tutorials for this and my code matches those where it matters.</p>
  
  <p>the first part, SendEmail, works perfectly and emails the manager provided with the few needed columns needed to make a decision.  as well as 2 links to approve or deny.  these links are built by using the URL generated when i published the code and appending approval=true and the email of the person who submited the form request.</p>
  
  <p>the next part, doGet(e), is supposed to trigger when the link in the manager email is clicked and then generate an email to send to the requester, however, when the link is clicked it just brings me to a page that says "Invalid email: undefined" even though the URL at the top has all the right information.</p>
  
  <p>what am i missing here?</p>
  
  <p>edit: I was using this video to get the layout of most of the code:   <a href="https://www.youtube.com/watch?v=eduG0XZ9mDs" rel="nofollow">https://www.youtube.com/watch?v=eduG0XZ9mDs</a></p>
  
  <p>code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function sendEmail(e){
    /**
   var email = e.values[1];
   var item = e.values[2]; 
   var cost = e.values[3];
    */
    var serviceInformation = e.values[1];
    var language = e.values[2];
    var meetingType = e.values[3];
    var eventDate = e.values[4];
    var clientName = e.values[5];
    var detailedDirections = e.values[6];
    var onSitePOCName = e.values[7];
    var onSitePOCNumber = e.values[8];
    var department = e.values[9];
    var contactPhoneNumber = e.values[10];
    var approval = e.values[11];  //the one we need to modify
    var requestorEmail = e.values[12];
    var managerEmail = e.values[13];
    var Language2 = e.values[14];
    var interpreterName = e.values[15];
    var interpreterAgency = e.values[16];
    var dateConformationSent = e.values[17];
    var specialNotes = e.values[18];
    
    
    var url = 'https://script.google.com/a/macros/richmond.k12.va.us/s/AKfycbwuRr1boKTH0v1mprWmc7PE66_mQ_dmPE0lyWb7vkfiyW3pn31b/exec';
   
    
    /**might be that the &amp; needs to be a ?*/
    var approve = url + '?approval=true'+'?reply='+requestorEmail;
    var reject = url + '?approval=false'+'?reply='+requestorEmail;
    
    var html = "&lt;HTML&gt;&lt;body&gt;"+
                 "&lt;h2&gt;please review&lt;/h2&gt;&lt;br /&gt;"
    +"&lt;P&gt;" + language +"  " + serviceInformation
    +"&lt;p&gt;" + meetingType+ "  on   "+ eventDate + "    for " +clientName
    +"&lt;p&gt;" + "Location: "+ department
    +"&lt;p&gt;" + "requester: "+ requestorEmail+ "  "+
      "&lt;p&gt;"+
      
      "&lt;a href="+ approve +"&gt;Approve&lt;/a&gt;&lt;br /&gt;"+
        "&lt;p&gt;"+
                
      "&lt;a href=" +reject+"&gt;Reject&lt;/a&gt;&lt;br /&gt;"+
                "&lt;/HTML&gt;&lt;/body&gt;";
                     
  
  MailApp.sendEmail(managerEmail, "Approval Request", "what no html?", {htmlBody: html});
    
  }
  
  
  function doGet(e) {
   
    
    var app = UiApp.createApplication();
    
    var aprovalResponce = (e.parameter.approval == 'true') ? 'Approved.' : 'Sorry, you need to reschedule';
    
    var msg = "Your manager said :" + aprovalResponce;
    
    var replyEmail = e.parameter.reply;
  Logger.log(replyEmail);
    
    MailApp.sendEmail(replyEmail, "Approval Request", msg);
    
    var helloWorldLabel = app.createLabel(msg);
    app.add(helloWorldLabel);
    
  
    return app;
  }</code></pre>
  </div>
  </div>
  </p>