Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Google Apps Script to get notified about the number of unread emails in an inbox
function unreadCount() {
var unreadCount = GmailApp.getInboxUnreadCount();
var masterEmail = "<your-email@something.com>";
var subject = "Your unread count";
var message = "You have " + unreadCount + " emails"
MailApp.sendEmail(masterEmail, subject, message);
}
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.