
Applying the filter to ALL emails from a certain domain.You can mix and match these to suit your needs, but are three main approaches to this: Within this window, you can enter any of the parameters that you want the filter to automatically apply to. From there, select the three horizontal dots at the top of the email and hit "Filter Messages Like These". Select an email you want the script to run on. It's a daunting process that will happen dynamically over time as emails come in. Don't feel obligated to create them all at once. Once you have your labels set up, create a few automatic filters so we can test our script. Make sure the labels are all lowercase, as it's case-sensitive. Within Gmail, navigate to the cog icon in the top right of the screen and select 'See All Settings' -> Labels. Set up two new labels, one called "archive me" and one called "delete me". The way we do this is by using Gmail's labels.
#MAIL ARCHIVER X GMAIL TROUBLESHOOTING ARCHIVE#
Step 01: Set Up Gmail Labelsįor the script to work, it needs information on what to archive and delete. Here's a link to a GitHub Gist the actual Google Apps Script. We combine this with the use of Gmail's automatic filtering system to create an easy-to-manage solution to a bloated inbox. This solution creates a Google Script that looks at your Gmail inbox for emails that have a certain label applied to them and then runs an appropriate function based on that label name once a day. Not really ideal and not easily implantable, so I took it upon myself to rebuild the script and add some modernization to it.
#MAIL ARCHIVER X GMAIL TROUBLESHOOTING CODE#
I finally stumbled upon a very very old post with a screenshot of some code inserted into Google Scripts. The result was a lot of abandoned Reddit threads and deleted files. I scoured the internet for a solution, but apparently, no one has revisited the subject since circa 2012. Users can set filters to automatically delete emails from certain senders or with keyword pattern matches, sure, but that's an instant filter and those emails never see the light of day. Surprisingly enough, Gmail does not have this as a native feature. The solution: tell Gmail to archive or delete certain emails after a specified number of days. I like getting shipping confirmations and updates, but all I need is a glance at the subject line and forget about it. But what about the emails that I WANT to see but aren't what I would consider 'mission critical'? For the most part, I enlist a barrage of filters (close to 200) to weed out emails I don't want or need.

It's overwhelming and a heft task to get my inbox down to 0. Generally, by day's end, I'll receive about 50 emails on my PB account and 30-40 on my personal. As is the case with everyone else, I'm constantly bombarded with automated emails about updates, shipping orders, security alerts, product surveys, 'gurus' offering their SEO services, and a billion other things.

We use Gmail and Gsuite as our primary email providers at Pixel Bakery.
