An open API service indexing awesome lists of open source software.

https://github.com/kartikmehta8/gmail-to-slack

This project listens to Gmail for new emails and automatically logs email information to a designated Slack channel in real-time.
https://github.com/kartikmehta8/gmail-to-slack

automation gmail-api slack-bot

Last synced: 2 months ago
JSON representation

This project listens to Gmail for new emails and automatically logs email information to a designated Slack channel in real-time.

Awesome Lists containing this project

README

        

# Gmail to Slack Email Logger

![Banner](./banner.png)

This project is a Node.js application that listens to new emails in a Gmail inbox and logs their details to a Slack channel using Slack Webhooks.

## Features

- Real-time email monitoring using IMAP.
- Sends email details to a specified Slack channel.
- Secure connection with Gmail and Slack.

## Prerequisites

1. **Node.js**: Ensure Node.js is installed on your system.
2. **Gmail Account**:
- Enable IMAP access in Gmail settings.
- Generate an App Password for secure authentication.
3. **Slack**:
- Create a Slack App and set up an Incoming Webhook. Refer to [SLACK.md](SLACK.md) for detailed instructions.

## Usage

1. Start the script:

```bash
node gmail_to_slack.js
```

2. The application will monitor your Gmail inbox for new emails and send their details to the configured Slack channel.

## Files Included

- **gmail_to_slack.js**: Main script to monitor Gmail and send logs to Slack.
- **SLACK.md**: Instructions to set up Slack Webhooks.
- **package.json**: Project dependencies and scripts.

## Customization

You can update the Slack message format or include additional email headers by modifying the `gmail_to_slack.js` script.