Skip to content

Instantly share code, notes, and snippets.

View guillaumegarcia13's full-sized avatar
πŸ’­
Building awesome things πŸš€

GARCIA Guillaume guillaumegarcia13

πŸ’­
Building awesome things πŸš€
View GitHub Profile
@guillaumegarcia13
guillaumegarcia13 / gmail_to_slack.js
Created October 30, 2020 10:38 — 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())