When I was still in college pursuing my Network Engineering degree, I was required to take a Database Management class. The professor who taught the class, Mary (I cannot for the life of me remember her last name because she INSISTED we refer to her by her first name!) was one of those oddly goofy, eccentric types. Simply put, she was a stereotypical Nerd, who absolutely loved everything about the course she was teaching, with a pleasantly refreshing sense of humor.
Like all other professors, Mary laid out course expectations as well as best practices for achieving course objectives. One thing she said has stuck with me for all of these years:
“When you are working on your projects, make sure you’re not working while you’re distracted. And don’t fool yourself – there is no such thing as ‘multitasking’. Either consciously or subconsciously, you are actually ignoring something else. With Database Administration, this can have disastrous results!”
That same principle Mary laid out about multitasking seems to also echo across the email landscape – specifically as far as Inbox Zero is concerned.
Although there are ample tips, tricks, and suggested best practices for managing one’s email, Inbox Zero quite often feels like the most impossible goal to reach. But I’m here to tell you there is a subtle, simple, automated trick for Gmail that can actually accomplish this seemingly lofty goal!
It Starts With A Change Of Mindset
One important thing to consider about email is to remember that email shouldn’t be used as a file storage solution. This may sound like an odd thing to say, but think about this: for some time now, I had email in my inbox dating back as far as 2006. Gmail launched in 2004. The vast majority of these emails were those I had told myself I would get to later, or that I felt I needed to hold onto “just in case”. However, upon reviewing many of them later on, I realized a truth about my email behavior and decided on a simple rule – if I don’t read or act on any email within x amount of time, then I’m not going to so it might as well be deleted.
One thing I’ve always been somewhat of a fanatic about is organizing emails into folders, directing incoming into their respective folders with the use of inbox filters. Since I handle all bills online, this helps me keep notices and communications with each service provider organized. As such, I have multiple email folders. And as one might imagine, these had also become over-filled as the years have gone by.
Establish A Time Frame
Ultimately I decided on some simple constructs regarding my general inbox, the folders I have setup for different bills, and the folders I have setup of other notifications from other services newsletters. You will need to come up with time frames that work best for you, but in general mine is as follows:
Inbox – 30 Days. Any “general” emails I receive in my inbox that aren’t filtered into specific folders. I’ve allowed myself 30 days to read, review, and/or respond. In my opinion, if I haven’t done so after 30 days, I’m not going to and there really is no need for these emails to simply sit in my inbox.
Bill Payment Due Notifications – 7 Days. As mentioned, I have multiple folders for these – everything from utility bills, to car payment reminders. Since I’m disciplined at adding these to my calendar (and Google helps make this super easy as it is), I have no need for these emails to linger beyond 7 days at most. I’ve even considered shortening this to maybe 2 days, but a week is ample time.
I have a few other miscellaneous folders that handle things like service and performance notifications that I set up to be sent to me from my Plex Server , which I don’t keep longer than a day. As such, I think you get the general idea.
So How Does It Work?
Other than realizing I had literally thousands of emails over a decade old just lying dormant in my inbox that I would physically never be able to address, I had also begun some spring cleaning of my Google Drive and realized the amount of space I was wasting on these old emails. Yes, if you’re not aware, email counts towards your Drive storage.
My initial approach was to find or come up with some sort of IFTTT recipe. But with the changes to the GMail API that Google implemented earlier this year, I simply couldn’t accomplish what I was looking for with IFTTT. But with determination (and some frustration) I finally found what I was looking for with the use of a tool that I had forgotten Google actually makes available to all – Google Apps Script.
Specifically, I came across this 2013 article from a very useful blog known as Skipser. In the article, Arun provides detailed instruction on how to use a very simple Apps Script that runs silently in the background, and immediately begins cleaning up your inbox and any other inbox folders you may have (if you’re like me). You can copy and create multiple scripts for each folder you may have in your GMail account.
There is one small suggestion I would add if you plan on applying this to multiple folders. The scripts themselves will be stored in your Google Drive. Again, if you’re an organizing freak like me, you may want to create a specific folder to house them in. For example, I created a folder and simply named it Email Scripts. For the first script you create, move it into that folder. Then, as you copy the script to adjust the parameters to apply to other folders, do so and move each of them there. Otherwise, Google will just automatically dump them into the general “My Drive” folder. If not having them in a folder doesn’t bother you, just leave as-is. In either case, the scripts will still run.
For those of you ready to jump right in without heading over to Skipser, here is the overview of the setup:
- First open this Google Script and select File -> Make a copy. This will create a copy of the script in your Google drive and open it.
- Set the value of “LABEL_TO_DELETE” with the label you want to enable auto-delete and “DELETE_AFTER_DAYS” with the age of an email in days after which it should get deleted.
- Select Run -> Initialize. Google will ask you to grant required permissions. The script will be running for only your personal account, so nobody else will have access to your data.
- Select Run -> Install. This will install and start the script for your account.
You are now all set. The emails in the label you specified will now get deleted automatically once they age out with the number of days you chose. Just make sure you don’t delete the script from your Google Drive. Also, if you want to stop purging mails any time, just open the script once again from your Google drive and select Run -> Uninstall.
You will note that it’s as simple as two lines of code:
var LABEL_TO_DELETE = “crapmail”;
var DELETE_AFTER_DAYS = “10”;
For your own personal use, simply change the values within the quotes. For example, I mentioned that I set emails to auto delete from within my general inbox after 30 days. Thus my values are as follows:
var LABEL_TO_DELETE = “inbox”;
var DELETE_AFTER_DAYS = “30”;
I simply copied this script into the designated folder and changed the label value to reflect specific bill folders that I mentioned earlier and the days value respectively.
If you have a lot of email like I did, you will need to simply give it time – the script isn’t an instant fix. You will notice the total count of emails you have start to decline as time goes by. You can also check “Trash” to be pleasantly surprised to see that you too had emails you were holding onto since 2006.
It is that simple! As you can see, with the use of this simple 2-lined script, you can conceivably reach the all-so-coveted Inbox Zero! Simply make a couple of tweaks to fit your needs.