I originally used [login to view URL] and added to codeigniter via composer. You can see the getClient function from there.
I have the following sample code I made which retrieves Gmail vacation response. As you can see, I update an element of the object to change the subject and attempt to send it back to gmail. It throws an error.
What I need is an example of how to set the subject, message, start and end date of the vacation autoresponder. Below is my broken attempt
public function setVacation($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);
// works to here
// change the subject of the out of office as a test
$results->responseSubject = 'Out of Office.';
$results2 = $service->users_settings->updateVacation($user,$vacation);
This throws the error.
A PHP Error was encountered
Message: Argument 2 passed to Google_Service_Gmail_Resource_UsersSettings::updateVacation() must be an instance of Google_Service_Gmail_VacationSettings, null given, called in .....
11 freelancers are bidding on average $36 for this job
Hello, Hope you will be doing well!! I have read your description and I understand your requirement and I can handle your project. Please discuss with me for more clarification. Thanks