Wednesday, September 21, 2011

Organize life with Gmail, Calendar and your mobile

Gmail is more than just email, it can be a powerful way to organize your life if you know how to use it.

In this blog post, I explain how to handle a few common tasks in order to be kept organized:
  • Let's assume you have a quick idea while you are away from your computer and want to make sure you don't forget it. How would you do that?
  • You want to postpone an email with a few days in your desktop computer or on your mobile.
  • You want to get a notified that someone did not reply your email in a certain amount of time while you expected a reply.
  • You want to have reminders of periodic events so that you don't forget birthdays, to put out the garbage, file your tax return, etc.
The main tool to organize your life around

That would be Gmail. Every task can be expressed as an email which shows up in your inbox. The solutions which I want to show you all based on the assumption that you read emails often and you can schedule your life around email. You can argue with this approach, there are pros and cons, but I leave it to the end of the post.

Smartphones are getting popular recently, they are part of the daily life of more and more people. I will show you how to use Gmail successfully (primarily Android, but an iPhone will work, too) on them.

Use stars to mark tasks

Gmail has a powerful and easily accessible function: you can mark an email starred with just a single click (on the star icon), a key press ('s') or a tap (on mobile).

This makes the star very useful to denote tasks to work on.

Use Priority Inbox

Now that you decided to use stars (at least I hope you did :) ), you probably want to show them in the most prominent place in your mailbox: in your Inbox page. With Priority Inbox, you can set it up easily.
  • Go to the Inbox settings by clicking the cog icon at the top right, then select "Mail settings", then select "Inbox".
  • Select "Priority Inbox" in Inbox type.
  • Set "Unread" as the first section.
  • Set "All Starred" as the second section. You can do it by selecting the dropdown menu at the second row, then select "More options...", then select "Starred".
  • You will see a similar screen if you did everything as I said (check the arrows): 

  • Save the settings if everything is OK.
With this setup, the first section of your inbox will be "Unread", here you can see all your incoming mails. The next section is going to be your task list (with the starred emails) and at the bottom, you will see the rest of your inbox.

Learn and use keyboard shortcuts

This step is not necessary, but it makes email handling much faster. You can turn on keyboard shortcuts in the mail settings main page (general). Here is the list of all keyboard shortcuts Gmail uses: Gmail keyboard shortcuts. You should learn at least the basics (navigation, compose, send), those are very useful.

Use Gmail Snooze

Ok, you have the daily tasks (starred messages) visible in your inbox, but you suddenly realized that you have too many things to do and you won't be able to get done everything today.

This is when the Gmail Snooze script is found to be useful. Once you set it up, you'll have 30 new labels under the "Later" label, one for each day. If you label an email with the "Later/3 days" label, then it will show up in your starred list 3 days after you put it there.

Here are the setup instructions: Gmail snooze.

Adding snooze labels to emails with the keyboard is very fast: press 'l' ("label"), then type the number of days you want to postpone the email to. If you don't have other labels with that number, then the first label will be the "Later/... days" label which is exactly what you want, and it will be selected. So you just need to press Enter and you are done. Otherwise you have to scroll down a little, find the label and then press Enter.

You can do the same on mobile as well. The Android Gmail client supports adding/removing labels. Press the "Menu" button on your phone and select "Change labels".

Track sent emails

One more use case for Gmail Snooze is to track the sent emails: when you send an email to someone to request something or expecting an answer, you can put a snooze label on it, so that you don't forget that you sent it. If the email ends up unanswered in your starred list, then you know that you have to ping that person again, or try another medium (phone, SMS, etc.).

Use drafts to create tasks

Ok, by now you are starting to get organized. Let's see how would you jot down a quick note on your mobile what just came into your mind but you don't want to forget until you get back to your computer?

Just open your Gmail app on your smartphone, hit Menu and then "Compose". Write your stuff into the subject line, then click "Save". Make sure you don't fill the recipients field so that you don't send out the email accidentally.

You can do the same at your computer as well: you can create messages, write a quick summary in the subject line, maybe a longer explanation in the message body.

Make sure that after you are ready with the new email, you either star the message or put a snooze label on it.

Use the Star Drafts script


What if you forget to apply a star or put a snooze label into a draft message? I've hidden my drafts folder from my main Gmail view (it always counts the messages and I don't like to see it), so it is possible that I just write a draft and I forget to star it.

Fear not, the "Star Drafts" script is to the rescue. If set up correctly, it runs every night and stars your forgotten draft messages (the ones which don't have a snooze label).

Here is how you can set it up: Star Drafts script.

Now you can forget starring your drafts messages if they are not urgent, which makes these things very fast.

Use Calendar to send periodic reminders about repeating tasks

Do you usually forget birthdays? Create a yearly repeating event in Calendar and set an email notification for it for 7 days. Then you have a week to prepare for that. You can handle a notification email as any other task you get in your inbox.

Tax return deadline? Other repeating tasks? Handle them the same way.

Handling emails on the Deskop

Now you are set up to handle emails effectively, here is how you use them when you are at your computer.

Your "unread" section is at the top of your Priority Inbox, so you won't miss new emails when they come in. When you handle a new email, you should do one of the following with it:
  • Handle immediately: you should do it if it only if it can be done fast. New emails can come any time and interrupt your work, so if you want to focus on what you are doing, don't start acting on each of them.
  • Star it when you plan to act on it through the day.
  • Add a snooze label to it if you want to postpone acting on that task with a few days. As I described earlier, it is just a few keypress.
  • Leave it if the email is not actionable.
  • Add a note to it by just forward the email without filling the recipient field (keyboard: 'f', then use Tab to go to the body).
Handling emails on Mobile

Your mobile phone has a smaller keyboard and screen, and it is harder to type a reply email than at your desktop, so the chance that the email is not handled immediately is larger.

Everything is possible on the mobile Gmail that I described above at the desktop section (starring, adding a snooze label, adding a note), but it is a little more cumbersome: you cannot use the very fast keyboard shortcuts. I propose using the mobile mostly to read and star things instead only rather than really acting on the items unless they are urgent. The good news is that all changes are synchronized, so you can use all your devices and your web browser together.

Other solutions

There are a lot of other task handling or note taking applications out there for desktop, web and for mobile as well. They might be easier to use, nicer, etc, but I still prefer this solution, and here are the reasons why:
  • Gmail has a super usable web UI with keyboard shortcuts, themes, etc. (believe me, we worked on it a lot to be that usable), a decent mobile app (on Android, but it is not hard to set up on any other platform either). These two work very nicely together.
  • You can use all of them offline (the offline webapp is launched recently), they sync when they are online again.
  • Gmail being an email application is very tightly integrated with the email, which is the main communication platform and thus, there is no faster way to create a task from an email in either of the platforms.
  • You just need one place to manage your tasks and all your incoming communications. Every other communication system sends you a notification by email.
Summary

Now you have my version of a full blown workflow on handling tasks on a personal level. This might not be the best and probably not perfect, but I think that is good enough and scales pretty well with the tasks you need to handle and it works pretty well with a moderated number of incoming messages.

Btw if you have suggestions for a Gmail feature which can improve this workflow, don't hesitate to comment on this blog post or on the G+ post about it.

Enjoy and be productive!

Sunday, September 11, 2011

"Star Drafts" script

This script is a productivity tool which I use to make me remember that I forgot to send an email or just started a draft message to note something down and did not act on it yet.

If it is set up properly, then it runs once a day, and stars your draft messages which do not have certain labels.

Here is how to install the script:
  • Create a new spreadsheet in Google Docs: "Create new" / "Spreadsheet".
  • Create a new script: "Tools" / "Script Manager" / "New...".
  • Copy-paste the following code into the editor:
    // Config
    var MAX_DRAFTS_PER_HOUR = 30;
    var LABELS_PREFIXES_TO_SKIP = ['Snooze/', 'Later/', 'NoAction'];
    var MOVE_TO_INBOX = false;
    
    function starDrafts() {
      var drafts = GmailApp.search("in:drafts", 0, MAX_DRAFTS_PER_HOUR);
      for (var i = 0; i < drafts.length; i++) {
        if(needsStarring(drafts[i])) {
          starThread(drafts[i]);
          if (MOVE_TO_INBOX) {
            drafts[i].moveToInbox();
          }
        }
      }
    }
    
    function needsStarring(thread) {
      // The thread does not need starring if it already has a starred message.
      if (thread.hasStarredMessages()) {
        return false;
      }
      // If the thread has a snooze label, we don't need to star it either.
      var labels = thread.getLabels();
      for (var i = 0; i < labels.length; i++) {
        if (labelNameToSkip(labels[i].getName())) {
          return false;
        }
      }
      // Ok, here is something to star.
      return true;
    }
          
    function labelNameToSkip(labelName) {
      for (var i = 0; i < LABELS_PREFIXES_TO_SKIP.length; i++) {
        var l = LABELS_PREFIXES_TO_SKIP[i];
        if (labelName.slice(0, l.length) == l) {
          return true;
        }
      }
      return false;
    }
    
    function starThread(thread) {
      var messages = thread.getMessages();
      messages[messages.length-1].star();
    }
    
    
  • Save the script with the Disk (save) icon.
  • Try to run it once. Select the "starDrafts" function in the "select function" dropdown, then press the "Run" (play) icon. You can check how it works if you have a draft message in Gmail.
  • At the first run, you have to authorize the script to access your Gmail account. Just click through it once and then try to run it again, next time it would work.
  • You can tweak the script if you want in the config section.
  • If you are happy how it works, set it up to run every day: "Triggers" / "Current script's triggers" / "Add a new trigger". Select "starDrafts", "time driven", "Day timer", "4am to 5am" (or any other unlikely time you are up).
Now you are ready, happy starring!

Tuesday, September 6, 2011

Gmail Snooze - updated

The Gmail Snooze script was introduced about two months ago in the Gmail Blog. I had a very similar script for mutt about 4 years ago (just before I moved to Gmail), and I was very happy to see the Gmail version coming, this is an essential part of being productive.

I extended a script a little, so that it have the following functionality also:
  • It is extended to 30 days, so that you can postpone emails up to a month. Now that the label names are sorted numerically, these label names are in the proper chronological order.
  • It allows you to star the messages which are returned to the inbox. Only the last email will be starred in each conversation.
To install the script, follow the video tutorial in the official announcement, except that you should paste the script below the video instead:


The modified script is the following:
var PAGE_SIZE = 100;  // Don't use more than 100 because thats the max you can write
var MARK_UNREAD = true;
var STAR = true;
var DAYS = 30;

function getLabelName(i) {
  return "Later/" + i + " days";
}

function setup() {
  GmailApp.createLabel("Later");
  for (var i = 1; i <= DAYS; ++i) {
    GmailApp.createLabel(getLabelName(i));
  }
}

function moveSnoozes() {
  var oldLabel, newLabel, page;
  for (var i = 1; i <= DAYS; ++i) {
    newLabel = oldLabel;
    oldLabel = GmailApp.getUserLabelByName(getLabelName(i));
    page = null;
    while(!page || page.length == PAGE_SIZE) {
      page = oldLabel.getThreads(0, PAGE_SIZE);
      if (page.length > 0) {
        if (newLabel) {
          newLabel.addToThreads(page);
        } else {
          GmailApp.moveThreadsToInbox(page);
          if (MARK_UNREAD) {
            GmailApp.markThreadsUnread(page);
          }
          if (STAR) {
            var messagesToStar = [];
            for (var i = 0; i < page.length; i++) {
              var messages = page[i].getMessages();
              if (messages.length > 0) {
                var message = messages[messages.length - 1];
                messagesToStar.push(message);
              }
            }
            GmailApp.starMessages(messagesToStar);
          }
        }     
        oldLabel.removeFromThreads(page);
      }  
    }
  }
}
In the next blog posts I will write some more about how to use this for being productive (and not just procrastinate). :)