title: How do you automatically send a message to guests in a calendar invite?
body: <p>I'm using Google Apps Script to automate certain workflows. Whilst I can manually email guests in a calendar invite I've sent out, I'm struggling to find a way to write code that allows me to do this. The email must contain the google calendar invite, just as using the 'email guests' feature manually does. </p>
  
  <p>When I struggled to find an inbuilt CalendarApp function that allows me to do this, I tried using Gmail's SendEmail function, however I cannot find a way to attach the google calendar invite details.</p>
  
  <p>Any help is greatly appreciated. Thanks!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>function sendMatchReminders() {
  
    var today = new Date(),
        tomorrow = new Date(),
        i = 0,
        emails;
        
    tomorrow.setDate(today.getDate()+2);
        
    var events = CalendarApp.getCalendarById("MY_EMAIL").getEventsForDay(tomorrow, {search: 'vs'});
     
    for (var i=0; i&lt;events.length; i++) {
    
      emails = events[i];
     
    }
       
        
  }</code></pre>
  </div>
  </div>
  </p>