Create time-based Gmail filters with Google Apps Script - johneday: Create time-based Gmail filters with Google Apps Script
Somewhere between spam and archived messages are the emails that I want to glance at briefly, yet I don’t want clogging my Inbox when I forget to delete them. Apple Mail lets you create a rule for messages received greater than x days old. However, because the condition is only tested as messages arrive, none of the messages will meet the criteria. You can get around this by reapplying the rule, but that defeats the purpose of automating the process. Thankfully, Gmail users can take advantage of Google Apps Script to create time-based events that will move, mark, or label your messages without having to open a mail client.
For this example, let’s create a script that will delete all messages from the “delete me” label that are older than two days. First, make a new Gmail filter and populate the search options so it will catch all of your semi-spam. Remember to create and apply the “delete me” label to the matched messages.
No comments:
Post a Comment