Thanks to my Paper Backup I save all kinds of invoices and other documents I get by snail mail in my Google Drive. But of course there are also invoices that get delivered by email. Usually they come as a PDF attachment. Wouldn't it be nice to save those PDFs in Google drive as well?
Unfortunately Google Mail's filters do not allow to automate this. Luckily there's Google Apps Script.
I wrote a script to automatically save all attachments from mails within a certain Gmail label to Google Drive. Here's how you can use it, too:
Invoices. Feel free to create sub labels for more fine grained control.
GMAIL_LABELis the label you created in Step 1
GDRIVE_FILEis the path and file name that will be used to save attachements (see below for the placeholders)
mainmethod is called periodically (up to you how often).
After a while your attachments should start showing up in your Google Drive.
For configuring the location you can use the following placeholders in
| ||The original attachment name|
| ||The file extension of the original attachment|
| ||The domain part of the sender who sent the attachment|
| ||The sub label(s) under your configured label where the message was found|
| ||Year the message was received at|
| ||Month the message was received at|
| ||Day the message was received at|
| ||Hour the message was received at|
| ||Minute when the message was received at|
| ||Second when the message was received at|