Last active
February 11, 2018 16:33
-
-
Save Edo78/c9a78743424d0e9f96cc9cf329470ce0 to your computer and use it in GitHub Desktop.
A Google Apps Script that check how many unread spam are in your Gmail spam folder and log it to Stackdriver
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 spamMonitor() { | |
var unreadSpam = GmailApp.getSpamUnreadCount(); | |
var log = { | |
message: 'Discussioni non lette in Spam: '+ unreadSpam, | |
unreadSpam: unreadSpam | |
}; | |
if(unreadSpam == 0){ | |
console.info(log); | |
}else if(unreadSpam < 5){ | |
console.warn(log); | |
}else{ | |
console.error(log); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment