Google app script to automatically clean up Gmail inbox in a delayed fashion.
It is useful to receive some email notifications but after a while they become useless and start clogging the inbox.
This script will run every 30min (configurable) to archive messages based on a given list of filters/rules.
To make sure important messages are not archived, just mark them with a Star and they will be skipped by the script.
-
Open Google Drive
-
Click New -> More -> Google App Script:
-
Name the script and paste the code from Github (Code.gs)
-
Edit the filters as desired
-
Select runMyFilters and press Play button to test run the script:
-
Click Continue on the authorization required notice:
-
Allow the app to view and manage your mail:
-
Edit the triggers pressing the Clock button:
-
Add some triggers as pictured:
-
Done!