This script analyzes your Gmail usage and provides a monthly report of where your email comes from. This is done using Google Apps Script which runs in Google's datacenters, consequently your email is not exported out of Google. The script populates a Google spreadsheet in your Drive and then performs queries against the data and sends you a monthly report.
-
Open the script: gmail3
-
Open up the main.gs file and run the main function, this will kick off the first run and when finished schedule a trigger in the future to run the script again. Once the first run is completed you can close the script and it should continue to run at regular intervals in Google's datacenters. Think of it as a cron job running at Google.
-
Wait for the report to arrive in your inbox. How long this will take depends on your email volume. For example if you receive 6000 emails a month, it may take two or more days to process your inbox and receive a report, this is because, Google restricts the amount of processing time you are allowed per day.
To remove the script open it up and run the resetScriptState function.
- Grab nodejs dependencies
npm install
- Create a script project in your Google Drive called gmail3
- Create the following files in the gmail3 project, their contents do not
matter, but the file must exist for gas-manager to upload successfully.
- main
- gmail3
- gmail3MsgConsumers
- vendor-moment
- vendor-lodash
- vendor-objDB
- Setup gas-manager to allow uploading to Google Drive
gas init
-
Remove the
files
section from gas-project.json, as this information is provided by the Makefile -
Run
make
to upload your checked out copy -
Make some changes
-
Run
make
to upload your changes. -
Test you changes
-
Submit a pull request