1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-22 14:49:43 +02:00

feat: Slack bot notifications (#676)

This commit is contained in:
Matthieu Bollot 2024-04-08 00:33:29 +02:00 committed by GitHub
parent 22964cb375
commit 2f3dfe775e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 129 additions and 24 deletions

View file

@ -1,9 +1,17 @@
const buildAndSendSlackMessage = async (user, card) => {
await sails.helpers.utils.sendSlackMessage(`*${card.name}* was deleted by ${user.name}`);
};
module.exports = {
inputs: {
record: {
type: 'ref',
required: true,
},
user: {
type: 'ref',
required: true,
},
request: {
type: 'ref',
},
@ -21,6 +29,10 @@ module.exports = {
},
inputs.request,
);
if (sails.config.custom.slackBotToken) {
buildAndSendSlackMessage(inputs.user, card);
}
}
return card;