Dokončeno

gmail PHP api - sample code to setvacation in code igniter

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);

print_r($results);

// 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);

print_r($results2);

}

This throws the error.

A PHP Error was encountered

Severity: 4096

Message: Argument 2 passed to Google_Service_Gmail_Resource_UsersSettings::updateVacation() must be an instance of Google_Service_Gmail_VacationSettings, null given, called in .....

Dovednosti: Codeigniter, PHP

Zobrazit více: gmail api php send email, google-api-php-client codeigniter, google authentication api php example, google_client.php download, google calendar api php github, google plus api php, gmail api php example, gmail api php github, php sql sample code, php mysql sample code, shoppingcom php api sample code, sample cold fusion code ebay api, aspnet youtube api sample code, enom api sample php, webex api sample code design, php xmlreader sample code, twitpic api sample php, free sample online exam code php, plesk api sample code vba, code php login gmail php

O zaměstnavateli:
( 2 recenzí ) Sheffield, United Kingdom

Identifikační číslo projektu: #18008157

Uděleno uživateli:

royalrandhawa

"I CAN DO THIS EASILY WITHIN 3 HOURS" I am Full Stack Developer and Expert Designer, having expertise in web development, web UI/UX, Mobile App Development and Designing. Wordpress, Joomla, Magento including payment ga Další

$30 USD za 0 dní
(31 recenzí)
4.7

11 freelanceů na tento projekt zveřejnilo nabídku v průměrné hodnotě $36

imagicaworld

Dear Client , We are Really interested to do work with you , We are Web & Software development company having more than 6 year experience in Software development we totally committed to quality service, Transparen Další

$50 USD za 1 den
(91 Recenzí)
6.5
sharmarahulraman

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

$45 USD za 1 den
(88 Recenzí)
6.2
bjrupani

Hello hiring member i hope you are doing well i am bhavika i have 2.5+years experience in php , laravel , ajax,jquery , javascript , ajax,jquery html,css , bootstrap so i can do it so please give me chance to serve you Další

$30 USD za 1 den
(86 Recenzí)
6.0
indiainfosoft

Hello Sir, I've reviewed your requirement and I'm ready to work with you.I have almost 11+ years of experience in web development. I will provide quality work as well full support for any query. Kindly contact m Další

$50 USD za 0 dní
(156 Recenzí)
6.3
baxianupam

I have been successfully working in the field of Application Development, Web Development & Mobile development. Working as a Full time Freelancer, I also have a small team of five Developers and provide services Další

$30 USD za 2 dní
(6 Recenzí)
4.0
aswebsmart

Hi, I have read through your job descriptions, and I understand all of the requirements. I am applying because I believe that I have the required skill set to complete your project. I have been working as a PHP deve Další

$25 USD za 1 den
(11 Recenzí)
3.4
$25 USD za 1 den
(10 Recenzí)
3.2
iphygeniasoluti4

I , am having huge experience to take up challenges in the virtual world of internet .I offer complete web solutions including internet/Online marketing Product Vedios,Blog ,Content writing ,Copy Writing ,Email Market Další

$25 USD za 1 den
(0 Recenzí)
0.0
aritmukherjee

Hi, Ready to start the work. kindly share the required details so that i can start the work asap. If you have any other queries let me know. Thanks Arit

$30 USD za 1 den
(0 Recenzí)
0.0
devraghvendra11

Hi, I am Senior Web developer with the experience of seven years in IT industry (Web Development+Mobile App Design & Development, CMS development and much more). The website will be serviced as: -Pixel perfe Další

$55 USD za 1 den
(0 Recenzí)
0.0