-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dacastro4\LaravelGmail\Services\Message\Mail::__construct(): Argument #1 ($message) must be of type ?Google_Service_Gmail_Message, Google\Service\Exception given #275
Comments
I've temporary solved the problem by disabling the preload function. It seems that Google consider as too many requests when you try to preload a whole inbox. This is unexpected behavior from google anyway. |
Hi @stefanofinetti Here's the code snippet: |
Hi @umarzahid028 , this is the snippet of code I'm using right now in a live production environment. We use multiple accounts so you'll find the user auth: try {
The actual load of message is done after, in the view, in a foreach loop of all messages and for each call to $message i had to add ->load() before any other command: $messaggio->load()->getLabels() and so on. This is just a workaround untile preload() will work again (hopefully) |
Thank you for your reply. When I use message()->in('INBOX')->all();, I encounter a "Call to a member function flatten() on null" error.
|
That, i think, it's because you should use $message->load() && $message->load()->hasAttachments()) { // handle attachments } Without ->load() you stil do not have the message object fully loaded to be used. |
Thank you very much! ->load() method is also working for me. Once again, I appreciate you saving my time. |
Starting this week this package stopped working all of a sudden, producing this error message.
The complete error is:
Dacastro4\LaravelGmail\Services\Message\Mail::__construct(): Argument #1 ($message) must be of type ?Google_Service_Gmail_Message, Google\Service\Exception given, called in /var/www/istitutiraggruppati/mercury/vendor/dacastro4/laravel-gmail/src/Services/Message.php on line 149
It seems it get an exception from Google about "too many request" which is impossible: they have ONE page where they use the APIs to connect to google mailbox and read the incoming email. There is no automated or scheduled connection to gmail whatsoever in the entire site, just that page.
I tried to renews the oauth key in google console, I also tried to delete json credential files for users and have them authenticate again, but no luck.
The text was updated successfully, but these errors were encountered: