I use the following code to retrieve the vacation settings. It uses the Google API PHP client library and the Gmail API to gain access to the gmail platform
I cannot work out how to set a vacation. Does anyone have some sample code that does this?
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 stackoverflow sees it as too much code, but it works :) and i get vacation info.
}