gmail api php 更新假期
gmail api php updatevacation
我使用以下代码来检索休假设置。它使用 Google API PHP 客户端库和 Gmail API 来访问 gmail 平台
我不知道怎么安排假期。有没有人有一些示例代码可以做到这一点?
public function getVacation($userToken)
{
// Get the API client and construct the service object.
$client = $this->getClient($userToken);
$service = new Google_Service_Gmail($client);
// get the vacation settings
$user = 'me';
$results = $service->users_settings->getVacation($user);
print_r($results);
}
function getClient($userToken)
{
... a method that does the connection. for some reason Whosebug sees it as too much code, but it works :) and i get vacation info.
}
您应该考虑使用 Update vacation
$results = $service->users_settings->getVacation("me");
$results->responseSubject = 'Out of Office.';
$results = $service->users_settings->updateVacation("me", $results);
我使用以下代码来检索休假设置。它使用 Google API PHP 客户端库和 Gmail API 来访问 gmail 平台
我不知道怎么安排假期。有没有人有一些示例代码可以做到这一点?
public function getVacation($userToken)
{
// Get the API client and construct the service object.
$client = $this->getClient($userToken);
$service = new Google_Service_Gmail($client);
// get the vacation settings
$user = 'me';
$results = $service->users_settings->getVacation($user);
print_r($results);
}
function getClient($userToken)
{
... a method that does the connection. for some reason Whosebug sees it as too much code, but it works :) and i get vacation info.
}
您应该考虑使用 Update vacation
$results = $service->users_settings->getVacation("me");
$results->responseSubject = 'Out of Office.';
$results = $service->users_settings->updateVacation("me", $results);