laravel-gmail icon indicating copy to clipboard operation
laravel-gmail copied to clipboard

How do I receive incoming email alerts?

Open ghost opened this issue 4 years ago • 1 comments

I would like to receive notifications about changes in the mailbox and only then download unread emails from GMail. How to implement this?

ghost avatar Sep 01 '21 07:09 ghost

Added the setWatch function to the GmailConnection.php class

/** * Set up or update a push notification watch on the given user mailbox. * * @param string $userId * @param Google_Service_Gmail_WatchRequest $postData * * @return \Google_Service_Gmail_WatchResponse */ public function setWatch($userId, Google_Service_Gmail_WatchRequest $postData) { $service = new Google_Service_Gmail($this);

	return $service->users->watch($userId, $postData);
}

ghost avatar Sep 03 '21 05:09 ghost