Add a Second Inbox to Your Gmail

Last week I finally gave up and ditched Apple Mail in favor of using Gmail all the time for both work and personal email. I had been managing my work email via IMAP, but with such a large inbox I was beginning to notice performance issues. It was time to switch. I set my Sitening mailbox to forward all incoming mail to my Gmail account and got back to work.

It’s been a week now and so far I’m happy with the switch. My only complaint is the lack of separation between the two accounts I have living inside of Gmail. All of my work email is flagged with a “Sitening” label, but that’s not enough. I’m picky. I hate having to mouse all the way down the left side of the page to click the label just to see my work email. Viewing my Sitening outbox is even more of a pain. I have to search for “from:tyler@sitening.com”. That’s way too much effort. In lieu of an official Google one-click solution, I decided to fix the problem myself with Greasemonkey and a little javascript.

My goal was to add two new buttons to the top of my Gmail inbox. One to view my Sitening inbox and another to view my outbox. I won’t go into all the gory details of how I accomplished this (you can view the source if you’d like), but I will give a high level overview:

  • Create two buttons and insert them into the HTML where appropriate
  • Attach a click event to each one that
    • Fills in the Gmail search box
    • “Clicks” the search button

It worked great. Here are a few screenshots showing my new inbox in action.

Before:
GMail Before

After:
GMail After

You can see that I’ve added an extra two buttons that let me easily switch from one inbox to another. Also, I cleaned up the HTML a little bit so that instead of showing ugly search results like this:

Ugly Search Results

I get a nice, clean title like this:
Nice Search Results

If you’d like to add this feature to your own Gmail account you’ll need to be using Firefox and have the Greasemonkey extension installed. Then, just click this link to install. You’ll need to edit the script to match your email address. (Instructions are included in the script.)

Filed under: Google, JavaScript