Skip to content

Instantly share code, notes, and snippets.

@carlosf
Forked from milesgrimshaw/inbox_count
Created October 23, 2015 14:54
Show Gist options
  • Save carlosf/25d6804bafe9102b45d2 to your computer and use it in GitHub Desktop.
Save carlosf/25d6804bafe9102b45d2 to your computer and use it in GitHub Desktop.

Revisions

  1. @milesgrimshaw milesgrimshaw created this gist Sep 25, 2014.
    9 changes: 9 additions & 0 deletions inbox_count
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    function processInbox() {
    // get all threads in inbox
    var threads = GmailApp.getInboxThreads();
    data_id = '1t70IDdWcaJzCIIaNWm2nHSPKzetHfTxhkKc9jKkAlpA'
    var dataSs = SpreadsheetApp.openById(data_id);
    var sheet = dataSs.getSheets()[0];
    var current_date = new Date();
    sheet.appendRow([current_date, current_date.toISOString(),threads.length]);
    };