Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function deleteOldMail() {
var sheet = SpreadsheetApp.getActive().getSheetByName('label');
for(var row=2; row<=sheet.getLastRow(); row++){
var labelName = sheet.getRange(row, 1).getValue();
var days = sheet.getRange(row, 2).getValue();
var deleteThreads ='older_than:'+days+'d -is:starred label:'+ labelName);
for (var i = 0; i < deleteThreads.length; i++) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.