Actually there is a way (I use it myself).
Please follow these steps once:
Go to your Gmail account --> Settings
--> Filters and blocked addresses
.
Find your "typical" filter from your existing list of filters and check it's box you find on the left side. (make sure you choose just one filter -at least till you get the hang of the process).
Now go to the bottom of the page and on the left hand side click the Export button. Download and save the created mailFilters.xml
file.
Make a copy of it (just to be on the safe side), rename it to whatever you want (eg: mailFilters-XYZ.xml
). This file will be your template. Open your new template with a basic text editor.
It will look something like this:
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:1522584886685</id>
<updated>2019-04-23T01:21:19Z</updated>
<author>
<name>your name</name>
<email>[email protected]</email>
</author>
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:1522584886685</id>
<updated>2019-04-23T01:21:19Z</updated>
<content></content>
<apps:property name='hasTheWord' value='Company XYZ'/>
<apps:property name='label' value='Clients/XYZ'/>
<apps:property name='shouldNeverSpam' value='true'/>
<apps:property name='smartLabelToApply' value='^smartlabel_personal'/>
<apps:property name='sizeOperator' value='s_sl'/>
<apps:property name='sizeUnit' value='s_smb'/>
</entry>
</feed>
This particular file reads that: when new mail arrives and
Includes the words: Company XYZ
Do this: Apply label "Clients/XYZ", Never send it to Spam, Categorize as Primary.
As mentioned, you execute the previous steps only one time.
You follow the next steps when you want to create a new filter.
Open your template, change Company XYZ
and Clients/XYZ
to whatever you like and save the file.
Go back to the bottom of your Gmail account --> Settings
--> Filters and blocked addresses
and click on the Import filters
link.
Choose file and Open file
Create filters. If you want check the Apply new filters to existing email
box as well.
Enjoy your new filters.
The beauty of this process is that once you understand it, you can download several -even different- filters in just one mailFilters.xml
file, create a "multi-filter" template and change/import them all together or a choice of them.
EDIT following your comment:
"Is there any documentation on the format used in the XML file?"
You can use one of the online .xml viewers (Free Online XML Viewer & Formatter) to help you further analyze the file.
"I would like to use multiple words with AND or OR in the query"
What you need to look into is the Gmail Operators.
As an example, you could apply one filter to all emails from John or Bob or Jane by using
From: [email protected] OR [email protected] OR [email protected]