so i want send invitation email to attendees on an event created on google calendar. but when i did
use Spatie\GoogleCalendar\Event as GoogleCalendarEvent;
$calendarEvent = new GoogleCalendarEvent;
$calendarEvent->name = $event->title;
$calendarEvent->startDateTime = $event->start_date;
$calendarEvent->endDateTime = $event->end_date;
$calendarEvent->addAttendee(['email' => '[email protected]']);
$calendarEvent->save();
I get error as
{ "error":
{ "errors": [{
"domain": "calendar",
"reason": "forbiddenForServiceAccounts",
"message": "Service accounts cannot invite attendees without Domain-Wide Delegation of Authority."
} ],
"code": 403,
"message": "Service accounts cannot invite attendees without Domain-Wide Delegation of Authority."
}
}
So I already gave a domain-wide authority to the service credential. But i am still getting the error because i tried to invite users using the service account. How can i impersonate a user using this service account in laravel 7 using Spatie\GoogleCalendar ?
I tried browsing google's api and Spatie's docs. but i can't find any