Skip to content

Instantly share code, notes, and snippets.

View VikramParimi's full-sized avatar
🚀
Launch Mode

Vikram Parimi VikramParimi

🚀
Launch Mode
View GitHub Profile
@VikramParimi
VikramParimi / gmail_to_slack.js
Created July 14, 2021 04:43 — forked from andrewmwilson/gmail_to_slack.js
Google Apps Script: Send Gmail emails to Slack
// You will also need to create a gmail filter to add the 'send-to-slack' label
// to any emails you want sent to slack
function sendEmailsToSlack() {
var label = GmailApp.getUserLabelByName('send-to-slack');
var messages = [];
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
messages = messages.concat(threads[i].getMessages())