title: Email a reminder based on the status of a cell Google apps script
body: <p>I am attempting to set a simple reminder email to a technician to remind when a routine service is due. I have a 2d array and code that works, but it only sends 1 email, which is the lowest row.
  I'm kinda new to this, but I would like it to run through each row and send a reminder for every overdue.
  Any help appreciated.</p>
  
  <p>This is what I have now:</p>
  
  <pre><code>    function Email_Reminder() 
      {;
  
      var sheet = SpreadsheetApp.getActiveSheet();
  
      statusArray = sheet.getDataRange().getValues();
  
      status = "overdue";
      for (i=3;i &lt; statusArray.length;i++){
      if (status == statusArray[i][6]) {
      var customer = statusArray[i][0];
      }
      }
      var email   = "djens12@gmail.com"
      var subject = "Reminder";
      var body    = "This is a reminder that the service is overdue for " +customer+ "";
  
                        MailApp.sendEmail(email,subject,body,{NoReply : true});
                        }
  </code></pre>
  
  <p>thanks</p>