【发布时间】:2020-05-01 08:12:56
【问题描述】:
所以我想向在谷歌日历上创建的活动的与会者发送邀请电子邮件。但是当我这样做时
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' => 'isley269@gmail.com']);
$calendarEvent->save();
我得到错误
{ "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."
}
}
所以我已经为服务凭证授予了域范围的权限。但我仍然收到错误,因为我尝试使用服务帐户邀请用户。我如何使用 Spatie\GoogleCalendar 在 laravel 7 中模拟使用此服务帐户的用户?
我尝试浏览 google 的 api 和 Spatie 的文档。但我找不到任何
【问题讨论】:
标签: laravel google-calendar-api