When your company uses Google Apps for Work, you receive an interesting report each month. Google tells you who makes the most use of Google Apps: who sends the most email from Gmail, who has the most files in Drive, and so on. A few months ago I began noticing something scary on this report: I receive more email than anyone else in the company.
I’m on lead lists, so I receive a ton of spam from recruiters and IT salespeople. I trade my email for white papers, which leads to newsletter subscriptions. Coworkers send me email drafts to review and articles to learn from. But the bulk of my incoming email comes from automated systems. I receive build notifications, crash reports, server alerts, and all manner of thing that I never even consider reading. But then there are the things I do need to open, like purchase receipts and updates to shared documents.
A lot of the automated email requires some action on my part. These actions are typically rote. Having finally realized I spend too much time in email, I decided to do something about the deluge of automated crap I have to handle.
Gmail filters are powerful, but can only do so much. I needed something more ridiculous. Sometimes you need to read the contents of a file attachment, find a name or number that tells you to do something, and then do some conditional file manipulation based on what you read, right?
Enter ruby-gmail, a handy library I found for manipulating Gmail messages in Ruby. In an hour, I had a script that could grab copies of some common receipts and save them off to an appropriate folder shared on Google Drive. I took this prototype and began performing scheduled scans of my inbox, eliminating the need to do anything with a few boring messages each week. Every time something new crops up that I’d like to automate, I find the most relevant function I’ve made to handle past messages and make a copy to handle the new message. Within two weeks – a total of a couple of hours of effort – I eliminated the need to touch most recurring receipts.
This type of scripting is nothing new, but finding how simple it was to eliminate some personal grunt work was exciting. I’m left wondering what I should tackle next. Dare I attempt to automate some of my email conversations?