【问题标题】:Update attendees response status - Google Calendar API (PHP)更新与会者响应状态 - Google Calendar API (PHP)
【发布时间】:2015-03-30 18:19:32
【问题描述】:

我制作了一个使用 Google Calendar API 和 Oauth2 的小应用程序。 现在我想允许用户在活动中回答。这是我的代码:

PHP

if(isset($_POST['submit'])){

    $eventSubmit = $service->events->get('primary', $_POST['eventID']);
    $attendeesSubmit=$eventSubmit->getAttendees();

    foreach ($attendees as $attendee) {
        $mailSubmit = $attendee->getEmail();

        if ($mailSubmit==$emailUser){

            if ($_POST['status']=='accepte'){
               $attendee->setResponseStatus('accepted');
               $service->events->update('primary', $_POST['eventID'], $eventSubmit);

            }
            if ($_POST['status']=='decline'){
                $attendee->setResponseStatus('decline');
            }

        }

}

HTML

    <form method="post" action="index.php">
    <input type="radio" name="status" id="accepte" value="accepte">Confirmer</input>
    <input type="radio" name="status" id="decline" value="decline">Décliner</input>
    <input type="hidden" name="eventID" value="<?php echo htmlspecialchars($event['id']); ?>">
    <input type="submit" name="submit" value="OK"></br></br>

但它不起作用,当我提交表单时,用户的响应状态不会改变。有什么问题?

【问题讨论】:

  • 请解释清楚您的问题?当受邀者接受邀请时,您没有收到通知吗?是这种情况,在您的日历设置中将remindOnRespondedEventsOnly 更改为true。检查此链接developers.google.com/google-apps/calendar/v3/reference/…
  • 不,我创建了一个小表单,在该表单中,对于他被邀请的每个事件,用户可以选择一个答案:接受或拒绝。但是,当我提交表单时,用户的答案在这个事件中没有改变,我不明白为什么

标签: php google-calendar-api


【解决方案1】:

活动创建者/所有者无法修改与会者的回复。只有与会者可以修改他们的状态。与会者需要自己从 Google 日历 UI 做出响应,或者您需要以与会者用户身份进行身份验证并更改他们的响应状态。

【讨论】:

  • 是的,我知道,所以当我测试我的应用程序时,我使用自己的 Google 帐户登录并尝试响应我自己的事件(其他人邀请我)而我的应用程序没有工作。也许无法使用 Google Calendar API 修改状态,只能使用官方日历?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-10-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多