Created
September 12, 2023 17:57
-
-
Save jarrodhroberson/2fed3a2904bb25a05a5eea1a9b040cc2 to your computer and use it in GitHub Desktop.
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 purge() { | |
var promotions = GmailApp.search("category:promotions") | |
for (var i = 0; i < promotions.length; i++) { | |
Gmail.Users.Threads.remove('me', promotions[i].getId()) | |
} | |
var forums = GmailApp.search("category:forums") | |
for (var i = 0; i < forums.length; i++) { | |
Gmail.Users.Threads.remove('me', forums[i].getId()) | |
} | |
var updates = GmailApp.search("category:updates") | |
for (var i = 0; i < updates.length; i++) { | |
Gmail.Users.Threads.remove('me', updates[i].getId()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment