Created
July 7, 2017 00:17
-
-
Save hmsk/f2ec6bcc14f030041cea0e4be9357136 to your computer and use it in GitHub Desktop.
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
robot.router.post '/hubot/an-endpoint', (req, res) -> | |
payload = req.body || { recipient: null } | |
unless payload.recipient == 'my-mailgun@email-address' | |
res.writeHead(403) | |
res.end() | |
return | |
res.writeHead(204) | |
res.end() | |
att = | |
color: '#dedede' | |
fields: [] | |
fallback: 'Email received' | |
thumb_url: null | |
title: payload.subject | |
title_link: null | |
pretext: ':inbox_tray: メールを受信したよ' | |
text: payload['body-plain'] | |
author_name: payload.from | |
author_link: null | |
author_icon: null | |
ts: payload.timestamp | |
robot.messageRoom '#sandbox', attachments: [att] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment