You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const IncomingWebhook = require('@slack/client').IncomingWebhook;
let MY_CHANNEL_URL = <your webhook url>
let myChannelWebhook = new IncomingWebhook(MY_CHANNEL_URL);
// Set up like this so you can add helper functions to easily message different channels
exports.messageMyChannel = function(message) {
return postSlackMessage(message, MyChannelWebhook);
}
function postSlackMessage(message, webhook) {
return webhook.send(message, function(err, res) { /* ... */ });
}
main.js
const slackService = require('./slackService');
Parse.Cloud.afterSave('MyClass', (req) => {
let message = 'This is the message I want to send';
slackService.messageMyChannel(message);
});
Obvs some Slack configuring to do, but that's the basic gist.
Anyone have any pointers or howto on this?
The text was updated successfully, but these errors were encountered: