Archiving Gmail (Part 2)
/In my last post, I addressed one of the issues I had with a script I had found that archives Gmail messages to PDF files and how to fix the issue of it creating needless temporary files that count toward your daily quota.
The remaining issues I had I addressed by moving the entire script from a Google spreadsheet to a Google web app script. This was the original script UI:
And here is the new UI:
As you can see, I it has a few more options than the original. The gist of it is
- you select the Gmail Label you want to use as a filter, you optionally select a label you want to ignore (You could create two labels for example 'Archive' and 'Processed'). You can also add your own custom filter to include or exclude additional messages.
- Choose if you want to save the attachments (If you are archiving the emails to PDF).
- Optionally you can have it remove the first Label (e.g. 'Archive') and Optionally add a new label (e.g. 'Processed'). Both of these are helpful when you have a large number of emails to process and may bump against your daily Quotas for creating or forwarding mail.
- If you want to Archive them, you can archive them to PDF with the attachments saved as separate files, or you can save them to EML files with the attachments embedded in the original email. You can change the naming convention to a few different formats (This makes it easier to sort them later so you could specify From-Date-Id instead for example)
- Or you can bulk forward them to some specified recipient(s).
If you want to see the finished product here is the link. You will need to authorize it to access your mailbox etc since obviously it is processing mail.
So where to begin?
First you need to setup your Google Drive to write the scripts.
- In Drive, Click Create -> Connect More Apps
- Search for "script" and connect to Google Apps Script
- Now create your first script by creating a new script. The type you want will be Script as Web App which will be available after you choose Script from the below image.
- You will now have your development environment all set to start scripting!
Well, this is getting rather long, so in the next post I will just dump the code for the app I wrote and walk you through it. Click Here to see Part 3