A Google Apps Script for Creating Filters
Enable Advanced Gmail Service
Now, set up a label in gmail called
filter. When you apply this label on a new message, the script will create a filter to move the message and subsequent messages from the same sender out of your inbox (archive / mark as read).
When run, this script will go through your inbox and find all threads labeled 'filter'. The script will get the sender of each thread marked 'filter' and create a new gmail filter to be applied to future emails from the same sender. The filter will mark the email as read and archive it. Lastly, the script will apply these same actions to the thread labeled 'filter'.
- Better logging - e.g. to spreadsheet
- More filter options - e.g. based on additional criteria than just the sender
- Turn this into an add on
- Generate reports with summaries of number of filters created over a period of time
- Prevent duplicate filters from getting created