Skip to content

Commit

Permalink
Change view task link to a button
Browse files Browse the repository at this point in the history
  • Loading branch information
majidalavizadeh committed Jun 4, 2020
1 parent 49dbf66 commit 1fae6ea
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions Notification/Slack.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,28 @@ public function getMessage(array $project, $eventName, array $eventData)
$message .= $title;
$message .= ' ('.$eventData['task']['title'].')';

$attachment = [];
if ($this->configModel->get('application_url') !== '') {
$message .= ' - <';
$message .= $this->helper->url->to('TaskViewController', 'show', array('task_id' => $eventData['task']['id'], 'project_id' => $project['id']), '', true);
$message .= '|'.t('view the task on Kanboard').'>';
$attachment_link = $this->helper->url->to('TaskViewController', 'show', array('task_id' => $eventData['task']['id'], 'project_id' => $project['id']), '', true);
$attachment = [
[
'fallback' => 'View task on ' . $attachment_link,
'actions' => [
[
'type' => 'button',
'text' => 'View Task',
'url' => $attachment_link,
'style' => 'primary'

]
]
]
];
}

return array(
'text' => $message
'text' => $message,
'attachments' => $attachment
);
}

Expand Down

0 comments on commit 1fae6ea

Please sign in to comment.