Last active
October 19, 2018 09:27
-
-
Save gwire/64cb546a9635120f2535bdb154361d5f to your computer and use it in GitHub Desktop.
Simple email notifications in Slack
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
require ["enotify", "variables"]; | |
if header :contains ["Subject"] ["Urgent","Emergency","You done goofed"] { | |
if header :matches "Subject" "*" { set "subject" "${1}"; } | |
if header :matches "From" "*" { set "from" "${1}"; } | |
notify :importance "3" :from "New message notification <test@example.com>" :message "${from}: ${subject}" "mailto:0xdeadbeef@example.slack.com"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although, while most appear in a timely fashion I've seen one where the time between being accepted by the remote mailserver and appearing in the channel was a couple of hours. So don't necessarily rely on it.