I am using google calendar API with the JAVA client library to create event and send invitation to attendees.
I have some requirement where I want to add new attendees after the event has been created. I am able to add attendees successfully but since I am sending notification on adding attendees (actually on all updates), the code sends email to all attendees even if I add one attendee to the list.
Can anyone please help to change the setting so that if I make some updates to the content like Title, time, description, location etc. Then the mail should be send to all the attendees; but if I add an attendee then only that attendee must receive an email that he/she has been invited.
Code for adding attendees:
Event event = service.events().get("primary", eventId).execute();
List<EventAttendee> attendees = event.getAttendees();
attendees.add(new EventAttendee().setEmail("[email protected]"));
event.setAttendees(attendees);
Event updatedEvent = service.events().update("primary", event.getId(), event).setSendNotifications(Boolean.TRUE).execute();