-
Notifications
You must be signed in to change notification settings - Fork 1
Google App Script
HOA PHAN edited this page Jun 1, 2023
·
1 revision
// function batchDeleteEmail() { // var batchSize = 100 // Process up to 100 threads at once // //https://developers.google.com/apps-script/reference/gmail/gmail-app#search(String,Integer,Integer) // var threads = GmailApp.search('label:github-notification');// Argument max cannot exceed 500 // //var threads = GmailApp.search('label:github-notification',0,500);// Argument max cannot exceed 500 // Logger.log('Started with %s', threads.length); // for (j = 0; j < threads.length; j+=batchSize) { // GmailApp.moveThreadsToTrash(threads.slice(j, j+batchSize)); // Logger.log('%s deleted', batchSize); // } // }