When I insert an event into Google Calendar using the Java API on Android, the event gets created, but the attendees do not get an invitation email, even though send notifications is set to true.
final Event event = new Event()
.setSummary(topic)
.setStart(new EventDateTime().setDateTime(startTime).setTimeZone(timezone))
.setEnd(new EventDateTime().setDateTime(endTime).setTimeZone(timezone))
.setAttendees(Arrays.asList(new EventAttendee().setEmail(inviteeEmail), new EventAttendee().setEmail(hostEmail)))
.setOrganizer(new Event.Organizer().setEmail(hostEmail))
.setHangoutLink(null);
try {
final Event insertedEvent = getCalendarService(googleAccountCredential).events().insert(CALENDAR_PRIMARY, event)
.setSendNotifications(true).setOauthToken(googleAccountCredential.getToken()).execute();
return insertedEvent.getId();
} catch (final Exception e) {
I have tried the suggestions listed in similar questions to no avail. Are there any conditions under which an invitation e-mail would not be sent?
UPDATE: emails go out when the invitee is in the same Google for Work domain as the sender, but not when they are not (for example [email protected] inviting [email protected], joe does not get an invitation email)