This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@moduledoc """ | |
This file showcases how the actor pattern works in elixir by using send/receive | |
to pass messages and spawn to create a separate state for an actor. | |
import ActorTutorial | |
Create a tally actor and send a message | |
tally = start_tally() | |
send tally, {:add, 5} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()) |