Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create an event on another users google calendar without reminders/notifications

I try to create events for the users in my organization with a service account for which it is not needed that there is a reminder. Things like public holidays etc...

I add to the event a reminders object to override the default:

EventReminder[] reminderOverrides = new EventReminder[] {};
Event.Reminders reminders = new Event.Reminders()
    .setUseDefault(false)
    .setOverrides(Arrays.asList(reminderOverrides));
event.setReminders(reminders)

Unit test and functional tests show there are no reminders attached when I check from a service account.

However when I login with user credentials, the default reminders are still visible.

What do I need to do differently so that people are not disturbed early in the morning on a public holiday?

like image 996
Peter Tillemans Avatar asked Feb 09 '17 18:02

Peter Tillemans


People also ask

Are reminders visible to others in Google Calendar?

You can use reminders in Google Calendar to track tasks. Reminders repeat every day or until you mark them as done. Reminders are private and cannot be shared with others.

Can two people add events in a Google Calendar?

Anyone with full access permissions to your calendar will be able to: respond to invitations. create and edit events. share your calendar with others.


1 Answers

When using the service account you should be aware to impersonate the user and not use the admin account. When an event is created by the admin account the default settings are taken from the user calendar settings. But when you impersonate the user you can turn off the notifications.

From the rest API documentation:

It's possible to specify the email address of the user account with the setServiceAccountUser method of the GoogleCredential factory.

like image 63
Greg Avatar answered Nov 21 '22 16:11

Greg