title: First Event invite using CalendarAPI
body: <p>Can someone please advice on the code to use to send the first invitation to an event?  For example the event does not have any attendees (aka the first attendee of the event).</p>
  <pre><code>function sendInvite(calendarId, eventId, emails) {
    var event = Calendar.Events.get(calendarId, eventId);
    event.attendees.push({email: emails});
    event = Calendar.Events.patch(event, calendarId, eventId, {
      sendNotifications: true
    });
  }
  </code></pre>
  <p>so, my test workaround was as follows but....even though the script does not error, no invite is sent.</p>
  <pre><code>function addGuestAndSendEmail(calendarId, eventId, newGuest) 
  {
    var event = Calendar.Events.get(calendarId, eventId);
    var attendees = event.attendees;
    if(attendees == null) 
      {
        {attendees = {email:  newGuest}}
      }
    //   {attendees = {email:  newGuest}}
    else 
      {attendees.push({email: newGuest})
    };
    var resource = { attendees: attendees };
    var args = { sendUpdates: &quot;all&quot; };
    Calendar.Events.patch(resource, calendarId, eventId, args);
  </code></pre>