-
-
Save johnvilsack/5e68b76a39e82c85fe0e0f4ac65ff428 to your computer and use it in GitHub Desktop.
Google-Apps-Script: getThreadsByLabel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getThreadsByLabel(label) { | |
const threads = GmailApp.getUserLabelByName(label).getThreads(); | |
var threadList = []; | |
for (i = 0; i < threads.length; i++) { | |
threadList.push(threads[i].getId()); | |
} | |
delete threads; | |
return threadList; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment