Created
September 4, 2014 07:00
-
-
Save jollychang/40846431714d41f1b50e to your computer and use it in GitHub Desktop.
用google script每天清一下qaci的邮件,前提是收件人为[email protected]的邮件已做filter标记为“QA/jenkins/from_qaci” 直接执行 https://script.google.com/a/macros/douban.com/s/AKfycbwpuCzHvunxGoC34cJIevKsilqH_p57GcDvB_ZzWXqYPv5basTV/exec
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
// https://script.google.com/a/macros/douban.com/s/AKfycbwpuCzHvunxGoC34cJIevKsilqH_p57GcDvB_ZzWXqYPv5basTV/exec | |
/** | |
* Retrieves a given user label by name and logs the number of unread threads | |
* associated with that that label. | |
* For more information on interacting with GMail labels, see | |
* https://developers.google.com/apps-script/class_gmaillabel | |
*/ | |
function processLabel(labelName) { | |
// get the label for given name | |
var label = GmailApp.getUserLabelByName(labelName); | |
// get count of all threads in the given label | |
// var threadCount = label.getUnreadCount(); | |
var threads = label.getThreads(); | |
for (var i = 0; i < threads.length; i++) { | |
threads[i].moveToTrash(); | |
}; | |
}; | |
/** | |
* move mail from label to trash | |
*/ | |
function moveJenkinsMailToTrash(){ | |
processLabel('QA/jenkins/from_qaci') | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment