gmail-to-slack

command module
v0.0.0-...-2fdebc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

README

Gmail to Slack

This simple tool gets unread messages with specified labels from a Gmail account and posts them to Slack channels. Messages are marked as read after posting to Slack and can optionally also be archived (removed from the Inbox).

By default the application looks for config.yaml in the current working directory but this can be overridden by setting an alternative path in the CONFIG_FILE environment variable.

Installation and Configuration

Building from source

To build just download the source and run go build. Currently it has only been tested with go 1.15 on Linux.

Configuration

There are some prerequisites which neeed to be set up before configuring the tool.

Slack webhook URL

This is a standard incoming-webhook URL for Slack. The channel associated with the URL does not matter as it will be overridden in the webhook calls.

This needs to be set up in the Google Cloud Console. The only OAuth 2.0 scope required by the tool is https://www.googleapis.com/auth/gmail.modify.

The basic steps are:

  1. Create a project
  2. Enable the Gmail API
  3. Configure the Consent Screen
  4. Generate an OAuth 2.0 Client ID.
  5. Download the json secret file from the Credentials page.

There is a more detailed step-by-step of how to configure the OAuth 2.0 settings in this tutorial for gphotos-sync: https://www.linuxuprising.com/2019/06/how-to-backup-google-photos-to-your.html

Once the prerequisites are in place, copy config.example.yaml to config.yaml and edit it to your requirements.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL