insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.26k stars 307 forks source link

Event attendees don't get email notification #601

Open ajkessel opened 3 years ago

ajkessel commented 3 years ago

I am creating test events with --who 'user@gmail.com'. The user does see an invite from within the calendar app, but strangely enough never gets an email notification that they've been invited to an event. Is this the intended/expected behavior? Whenever a calendar item is created in Google Calendar web interface with an attendee, that person is notified by email. Is there any way to trigger the notification from the CLI?

ajkessel commented 3 years ago

Figured it out. Patch below that causes email invites to be sent; perhaps this should be added as a command-line switch?

--- gcal.py.bak 2021-07-01 12:50:04.814334100 -0400
+++ gcal.py     2021-07-01 12:59:23.631646400 -0400
@@ -1371,7 +1371,7 @@

         event = self._add_reminders(event, reminders)
         events = self.get_cal_service().events()
-        request = events.insert(calendarId=self.cals[0]['id'], body=event)
+        request = events.insert(calendarId=self.cals[0]['id'], body=event,sendUpdates="all")
         new_event = self._retry_with_backoff(request)

         if self.details.get('url'):
@@ -1606,7 +1606,8 @@
                                         .events()
                                         .insert(
                                             calendarId=self.cals[0]['id'],
-                                            body=event
+                                            body=event,
+                                            sendUpdates="all"
                                         )
                                 )
                     hlink = new_event.get('htmlLink')
@@ -1625,7 +1626,8 @@
                                         .events()
                                         .insert(
                                             calendarId=self.cals[0]['id'],
-                                            body=event
+                                            body=event,
+                                            sendUpdates="all"
                                         )
                                 )
                     hlink = new_event.get('htmlLink')