Created
June 20, 2018 07:06
-
-
Save kiuchikeisuke/66e7783cd929c6b2b859eecd67266779 to your computer and use it in GitHub Desktop.
Gmailに来るConnpass通知をいい感じにSlackに通知する ref: https://qiita.com/k_keisuke/items/072086fa760300ac060b
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
var messages = thread.getMessages(); | |
var message = messages[0]; | |
var subject = message.getSubject(); | |
var body = message.getBody(); | |
var url = body.match(/<a href="https:\/\/.+\.connpass\.com\/event\/.+\/.+utm_content=detail_btn"/); | |
if(url != null) { | |
url = url[0].substring('<a href="'.length, url[0].lastIndexOf('/') + 1); | |
var msg = "*" + subject + "* \n" + url; | |
postToSlack(msg); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment