Created
March 9, 2016 20:53
-
-
Save emilong/2c497b7331eb008576f0 to your computer and use it in GitHub Desktop.
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 DeadMansSwitchGmailCheckIn() { | |
var messages = Gmail.Users.Messages.list("me", { q: "from: [email protected] label:unread" }); | |
if (messages.messages && messages.messages.length > 0) { | |
Logger.log(UrlFetchApp.fetch("Your Snitch URL")); | |
for (var i = 0; i < messages.messages.length; i++) { | |
var message = messages.messages[i]; | |
Gmail.Users.Messages.modify({"removeLabelIds": ["UNREAD"]}, "me", message.id); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment