Set of utility functions to be used with Google Scripts and deployed using Google's Clasp tool
This is based upon the Gist from This post about Google Scripts.
It's responsibility is to:
- Look for Google email threads in your Inbox that include the
auto-archive
label. - It will then attempt to find a
retention/<N>
tag on the threads - If the thread's last activity is older than
<N>
days ago, it will then archive your message.
- I have created 2 filters for
from: [email protected]
in my Google account.- The first filter adds the
auto-archive
label - Second filter add
retention/7
label
- The first filter adds the
- Scheduled the execution of the
emailArchiver
function to run with a Daily Trigger. This can be done by opening theProject Overview
clicking on the...
underProject Details
->Triggers
->+ Add Trigger
in the lower right
- I don't think it's possible to apply 2 labels to the messages as they come in with one filter. The API does allow one to lookup all of the
GmailLabel
s a user has on their account, this would be another way of handling this processing - Arrays (ex:
GmailLabels[]
) in the Script Console seems to be missing thefind
method. - Clasp's
.claspignore
does not seem to do the trick of properly respecting/ignoring the files we would like, hence thenpm run push
hack
- Find a way to create helper functions that will not interfere with the processing
- Create a
groupBy
function for arrays to allow for easier GmailThread => ThreadsByLabel map
- Create a