title: google apps script conditional if statement
body: <p>I'm fairly new to GAS but learning fast.  Thanks in advance for any help you can offer on this!!</p>
  
  <p>I need to be able to send an email to two different email addresses based on the first characters of my last name field.  So, if the first character of var last is A - L, send the email to this person, otherwise, if the first character is M - Z, send to this other person.  How would I create a conditional if statement for this?  My current script which currently sends all email to the same address is as follows:</p>
  
  <pre><code>function onFormSubmit(e) {
  
  var timestamp = e.values[0];
  var last = e.values[3];
  var first = e.values[4];
  var employment_status = e.values[5];
  var unemployed_date = e.values[6];
  var employment_type = e.values[7];
  var employer_name = e.values[8];
  var employer_address = e.values[9];
  var employment_begin = e.values[10];
  var comments = e.values[11];
  
  var email = "xxxxx@gmail.com";
  var subject = "Employment Update Received";
  
  var message = "&lt;HTML&gt;&lt;BODY&gt;"
  + "&lt;P&gt;Dear " + first + " " + last + ","
  etc. etc.
  + "&lt;/HTML&gt;&lt;/BODY&gt;";
  
  MailApp.sendEmail(email, subject, "", {htmlBody: message});
  }
  </code></pre>