question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How is gmail.new.get.* a replacement for gmail.get.visible_emails()?

See original GitHub issue

Hi, thanks for the library! Let’s say I need to programmatically select some emails on the users currently visible list of emails. gmail.get.visible_emails seemed like the right thing but I see it’s deprecated and I’m advised to use gmail.new.get.* instead.

I don’t see which of these is a replacement for that method though: email_data email_id thread_data thread_id

none of these return the list of emails as far as I can tell. Perhaps I’m misunderstanding, how exactly are those a replacement?

How would you advice getting the list of emails so I can select them. Should I use gmail.dom.inbox_content() and then find the rows that have checkboxes?

I will be happy to contribute to the library and help maintain, as I am working on a project that could potentially use this!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
josteinkcommented, Aug 2, 2019

How is gmail.new.get.* a replacement for gmail.get.visible_emails()?

Good question! It isn’t. Yet.

none of these return the list of emails as far as I can tell

Correct.

how exactly are those a replacement?

api.new.get.email_data() and api.new.get.thread_data() replace api.get.email_data() in the sense that api.get.email_data() will stop working, and those hopefully wont.

All other variations of api.get.*_email_data() are ultimately based on api.get.email_data() and will eventually stop working too.

What that ultimately means is that we’ve managed to provide decent replacements for api.get.email_data(), but not its contextual siblings.

How would you advice getting the list of emails so I can select them.

Use some jQuery/DOM selector magic to extract the new style IDs which represents visible emails, selected emails (or whatever) and use the new-style API to get data about those.

Should I use gmail.dom.inbox_content() and then find the rows that have checkboxes?

If that works, great. Maybe you can inspect its code and see if there’s room for optimizations when those two actions are combined too?

I will be happy to contribute to the library and help maintain

Sounds good. If so, PRs are definitely welcome.

This is a open-source library and any functionality currently present in this library has been provided by contributors like yourself scratching your own itch.

I scratched my own itch, which was the general reverse-engineering required for api.new.get.email_data() and api.new.get.thread_data(), which was no small task let me tell you.

If you can base your code on those, and extend the API with new methods like api.new.get.visible_email_data() or api.new.get.selected_email_data() that would be great and I’ll be glad to review and merge those PRs.

1reaction
mikobcommented, Aug 3, 2019

Makes sense. I’ll stay away from localized text, but still try to use other semantic props.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learn about the new integrated Gmail layout - Google Support
With the new layout, you can: View Google apps integrated into the Gmail main menu; View specific app menus in the collapsible panel;...
Read more >
Don't Like Gmail's New Look? Here's How to Switch It Back
How to Switch Gmail Back to the Old Look · Open Gmail in your web browser. · Select the Settings icon (top right...
Read more >
New Gmail rolls out to everyone, and you can hide that big ...
Click the settings gear, and you should still see a "Go back to the original view" option. This won't last forever, though, and...
Read more >
Create a mail merge with Gmail & Google Sheets | Apps Script
Click the following button to make a copy of the Gmail/Sheets Mail Merge sample spreadsheet. · In your copied spreadsheet, update the Recipients...
Read more >
Change Your Display Name in Gmail - OIT Service Center
You will also see the name they have entered for you on emails you receive from them. If your name has changed, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found