title: Update attendees when editing a Google calendar event with Google apps script
body: <h2>Situation</h2>
  <p>I have a calendar with a lot of events on it (staff appraisals).</p>
  <p>I've made a load of modifications (changing the length of the event etc.) but the invitations are going to people who have a lotus notes calendar (poor people).</p>
  <p>This means that unless I trigger what would be called &quot;Send notification?&quot; in the click-with-your-mouse version of things, they have no way of knowing that the event has been updated.</p>
  <p>(<a href="https://stackoverflow.com/questions/10846750/google-calendar-api-email-notification-ics-file">Similar Q</a>)</p>
  <p><img src="https://i.stack.imgur.com/lpinz.gif" alt="example of the update triggering" /></p>
  <p>In this example, the event I'm trying to trigger is the same one as is triggered when the <em>Send Update?</em> modal is accepted with <em>send</em>.</p>
  <h2>Code</h2>
  <p>Here's some example code that gets all the events on the <code>Appraisals</code> calendar and changes their location to 'the moon'.</p>
  <pre><code>function fixInvitations(){
    //get the callendar named &quot;Appraisals&quot;
    var cApp = CalendarApp.getCalendarsByName(&quot;Appraisals&quot;)[0];
    var events = cApp.getEvents(new Date(), new Date(&quot;Dec 30 2014&quot;));
  
    for (eIndex in events){
      var event = events[eIndex];
      event.setLocation(&quot;the moon&quot;);
    }
  }
  </code></pre>
  <h2>Question</h2>
  <p>How do I trigger an update to all parties invited to an event so that the changes are reflected in their calendars?</p>
  <p>Currently these events are now on the moon, but the update hasn't told people who are on non-Google calendars about the change.</p>
  <h2>Helpful, but not that helpful fact</h2>
  <p>The update email that manually triggering sends contains a <code>.ics</code> file (<a href="https://gist.github.com/notionparallax/9500649" rel="nofollow noreferrer">Gist of the contents</a>).  This contains a VCALENDAR and a VEVENT. From the <a href="http://en.wikipedia.org/wiki/ICalendar#Events_.28VEVENT.29" rel="nofollow noreferrer">Wikipedia page on VEVENTs</a></p>
  <blockquote>
  <p>For sending an UPDATE for an event the UID should match the original UID. the other component property to be set is:</p>
  <p><code>SEQUENCE:&lt;Num of Update&gt; </code></p>
  <p>I.e., for the first update:</p>
  <p><code>SEQUENCE:1</code></p>
  </blockquote>
  <p>So if there was a way to manually build an email with a <code>.ics</code> attachment it would solve the problem, but that feels like massive overkill. <a href="https://code.google.com/p/google-apps-script-issues/issues/detail?id=574" rel="nofollow noreferrer">This is mentioned here</a> but not resolved.</p>