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 gmailAutoarchive() { | |
var archived_threads = 0; | |
var delayDays = 2; | |
var maxDate = new Date(); | |
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time? | |
// getUserLabels returns an array of gmail labels. | |
// This way we don't have to convert the array elements and will archive all user labeled threads. | |
var labels = GmailApp.getUserLabels() |