0
votes

I'd like to retrieve messages in GMail/Inbox with a Google App Scripts. I'm able to retrieve labelled in a certain way with label.getThreads(). Now I'm moving away from labels and starting leveraging bundles: is there a way to get messages by bundle?

I don't know if GMail/Inbox uses a special label when bundling, in that case how do I get the names of these special labels?

GmailApp class doesn't contain anything helpful as far as I can understand.

1
Looks like bundles are just labels, since I'm able to search with something like label:promos; unfortunately GmailApp returns null when I try to get a label named "promos". - ccalboni

1 Answers

1
votes

Bundles like you pointed out are just special labels. For example you can do a search:

var updatesLabelThreads =  GmailApp.search("label:Updates");

This would return all the threads under the Updates bundle. In your reply to the original post you said 'promos' didn't work, but if you use 'Promotions' it will. search() will not match partial string.