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:
parent
22964cb375
commit
2f3dfe775e
9 changed files with 129 additions and 24 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue