Created
July 20, 2018 11:44
-
-
Save danielkhan/f6582fc134c7223bbc16adfa980ca680 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
module.exports.postProblemDetail = async (body, callback) => { | |
console.log(body); | |
if (body.type === "validate") { | |
return callback(null, success(say("Would you like to notify the person on call?", 'Notify Daniel'))); | |
} | |
if (body.type === "custom") { | |
return callback(null, success(say(`Notified Daniel`))); | |
} | |
if (body.type === "confirmed") { | |
const res = await axios.post('https://textbelt.com/text', { | |
phone: '+00000000000000000', | |
message: body.payload.problem.title, | |
key: '<secretkey>', | |
}); | |
console.log(res); | |
return callback(null, success(say("Notification sent"))); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment