https://github.com/ariasemis/propagate-gmail-label
Periodically add missing labels to gmail messages
https://github.com/ariasemis/propagate-gmail-label
apps-script clasp gmail google-apps-script typescript
Last synced: 3 months ago
JSON representation
Periodically add missing labels to gmail messages
- Host: GitHub
- URL: https://github.com/ariasemis/propagate-gmail-label
- Owner: ariasemis
- License: cc0-1.0
- Created: 2023-02-16T21:21:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-22T18:26:55.000Z (over 2 years ago)
- Last Synced: 2024-04-15T00:12:44.365Z (about 1 year ago)
- Topics: apps-script, clasp, gmail, google-apps-script, typescript
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/google/clasp)
In [Gmail](https://mail.google.com/), labels attach to individual messages, not whole threads. This means that new arriving messages in a thread will not always be given existing labels unless they are manually reapplied.
To work around this issue, this project uses a [Google Apps Script](https://script.google.com/) to periodically add missing labels to all messages affected.
## Installation
1. Enable the Google Apps Script API at https://script.google.com/home/usersettings
1. Create a new project at https://script.google.com/home
1. Clone or download this repository
```sh
git clone [email protected]:ariasemis/propagate-gmail-label.git
```
1. Edit `.clasp.json` file with the `scriptId` of the project you created
1. Push changes to google apps script project
```sh
npm install
npx clasp login # access your Google account
npm run push
```
1. Open project on script.google.com and run `install` function> To stop the script from running you can execute the `uninstall` function provided in the script.
## Settings
The following options can be configured in _Project Settings>Script Properties_:
| Property | Default Value | Description |
| -- | -- | -- |
| DAYS_BETWEEN_RUNS | `1` | Frequency in days at which the script will run |
| TIME_OF_DAY_TO_RUN | `5` | Specifies the hour at which the script runs |
| DRY_RUN | `false` | When `true`, the script will only log results without applying changes to message labels |
| MAX_THREADS_PER_RUN | `20` | Maximum number of message threads to process per run |
| NO_LABEL | `uncategorized` | Name of the label to add to threads without any label |## Acknowledgements
Inspired by [Tom Scott's post on fixing Gmail labels](https://www.tomscott.com/fix-gmail-labels-threads/).