Email Tips: Clean Up Your Inbox With A Google Apps Script

Email is undoubtedly important—and at the same time, it can be huge time drain depending on how much email you receive a day. And if your email inbox is anything like mine, well, it’s a jungle. Ready to tidy things up a bit? We stumbled on a Google Apps script that can help you better manage your Gmail inbox—no apps or extensions required.

We live our lives on a schedule (or try to, anyway)—so why not apply the same philosophy to your inbox? The Google Apps Script lets you automatically archive or delete old emails that are clogging up your inbox based on a schedule you create. The result? Time-based events that will move, mark or label messages—and you don’t even have to open your mail client!

I can hear your excitement. You’re ready to set it up, aren’t you? Let’s dive in with a hypothetical example. Say you want to get rid of deals, promotional emails or notifications that are two days old. To accomplish this, you’ll need to follow two steps:

1)    Create a “delete me” Gmail filter and populate the search options to catch your semi-spam as it arrives.

2)    Create a script that will delete all messages from the “delete me” label older than two days.

Once your filter has been created, go to https://script.google.com and create blank project. You’ll enter the following code, as written on John Day’s blog–head there to copy and paste the script.

Notice that, in the second line, you have the option to change the number of delay variables to specify how many days should pass before that particular matched message will be deleted from your inbox.

When you’ve filled in the variables, save the script, name your project and click Run. After that, Google will ask you to authorize the script to access your Gmail account. Your final step is the schedule the interval at which you want the script to run. Simply go to the Resources menu and select your desired interval.

Now that you’ve cleaned up older emails, what about the rest of your inbox? Don’t worry—there’s a script for that! You can easily archive older emails from your inbox using the Google Script here:

https://script.google.com/d/1FqkoGz0qhBxBfu2dbJMGL8yo-larautrN7ASJLHrGTxqkQtQNPEDX7CH/edit?usp=sharing

Simply copy and paste the script into https://script.google.com, specify your intervals and you’re set!

A quick note? If you want to clean up thousands of email messages, know that it will take time for the script to fully work. If you’d rather tackle your inbox in smaller batches, follow John’s steps to process email threads in groups of 100.

What do you think? Ready to give Google Apps Script a try? Be sure to let us know how it works. And if you have any other email management tips or tools, don’t be shy—give us the scoop!

Image: Mike Willis via Compfight cc

Share
Published by
Shelly Kramer

Recent Posts

How to Personalize Your Outreach Emails

Your outreach email pitch is crucial. Without your email reaching the recipient, no deal is…

1 year ago

Using Concepts From Other Industries to Create Innovative Marketing Materials

Using Concepts From Other Industries to Create Innovative Marketing Materials

2 years ago

How to Keep People Engaged with Your Page

There are constantly new trends in mobile that are evolving and expanding the way users…

2 years ago

How Mobile Marketing Is Evolving and Expanding

There are constantly new trends in mobile that are evolving and expanding the way users…

2 years ago

The Importance of Customer Reviews in Marketing

When it comes to your marketing strategy, the first and most important place to turn…

2 years ago

How Marketing Tech Can Ease the Difficulties of an Email Campaign

This article discusses some of the most effective marketing technologies available to help make your…

2 years ago