Skip to content

miriamsr/EmailDiscordScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EmailDiscordScript

Automatically posts emails in Discord for the entire team to access.

Setup

Important Note: These instruction assume that you already have Git and Node.js installed on your computer.

  1. Create a webhook in your team's Discord server. This can be done from the Integrations tab of channel settings.
  2. Enable the Google Apps Script API for your team account.
  3. Open a terminal window in the directory you want to use for the setup. Nothing saved there will need to be accessed once these steps are complete.
  4. Clone this repository.
git clone https://github.com/miriamsr/EmailDiscordScript.git
  1. Install clasp.
npm install -g @google/clasp
  1. Login to clasp. It will open a browser window and prompt you to login. Grant the permissions.
clasp login
  1. Create a new project.
clasp create --type standalone
  1. Push the code in this repo to your new project.
clasp push
  1. Open your project in the browser.
clasp open
  1. On line 2 replace YOUR_WEBHOOK_URL with the URL of the webhook you created earlier and save.
  2. Run the startTrigger function and authorize it. If it gives you a prompt about verification, click advanced and proceed.

Limitations

This is the best solution I could find given that Discord doesn't have an equivalent to Slack's email integration. There are some limitations to what we can do with a webhook. This script will only run once every 5 minues so there may be some lag before the email gets posted on Discord. Additionally, if you recieve an email in more than 20 threads during the 5 minute period, the script will only look at the 20 most recent threads. Finally, and probably the most annoying limit, is Discord's character limits. If you recieve a long email, it will be cut off in the Discord post and you'll need to log in to see the full email.

About

Script to post incoming team emails to Discord

Resources

Stars

Watchers

Forks