laravel-gmail
laravel-gmail copied to clipboard
How do I receive incoming email alerts?
I would like to receive notifications about changes in the mailbox and only then download unread emails from GMail. How to implement this?
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);
}