Code Monkey home page Code Monkey logo

Comments (6)

dacastro4 avatar dacastro4 commented on May 30, 2024

@Sokolfx when you try to get the subject it has to load the content and I have to get it first.

In your example your getting a collection of messages so you should loop through the messages and do {{ $message->getSubject() }}

from laravel-gmail.

Sokolfx avatar Sokolfx commented on May 30, 2024

@dacastro4 But can we take only headers, without preload/load?

I don't understand what you mean.
After $message = LaravelGmail::message()->take(100)->in('inbox')->all();
I use:

foreach($message as $messages) {
{{ $message->getSubject() }} // but without preload we haven't headers and can't use it
 }

*using with {{ $message->load()->getSubject() }} it's sure longer than preload when takes all messages.

from laravel-gmail.

dacastro4 avatar dacastro4 commented on May 30, 2024

@Sokolfx this is what you get when you request a list of emails https://developers.google.com/gmail/api/v1/reference/users/messages/list and this when you get the email item https://developers.google.com/gmail/api/v1/reference/users/messages/get#examples.
When you get the list, it doesn't come with headers so I have to load it to get even the title

from laravel-gmail.

Sokolfx avatar Sokolfx commented on May 30, 2024

@dacastro4 Ok. I inderstand what you mean. So what the way to return 10-50-100, >100 messages in few seconds? I tried with a couple of options. And with headers it's around 10-12 seconds for 10 messages.
Maybe I do something wrong, or is there another way out to return many messages with getSubject in 1-2 seconds?
Have you encountered a similar problem?

from laravel-gmail.

Sokolfx avatar Sokolfx commented on May 30, 2024

Ok, got it. Decided by Batching Request.

from laravel-gmail.

dacastro4 avatar dacastro4 commented on May 30, 2024

@Sokolfx I haven't encountered a similar problem. The app that I have runs in the background checking for the emails so it doesn't matter. I know it takes a little bit to get the information but that is how the gmail api works ): sorry. Hopefully batching your request at least helps you with the time.

from laravel-gmail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.