Skip to content
This repository has been archived by the owner on Nov 28, 2017. It is now read-only.

Commit

Permalink
Make slack message more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Chekalskiy committed Jun 4, 2015
1 parent 88e11be commit 502186b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/Reviewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,35 @@ public function sendReviews($reviews)
try {
if ($this->firstTime === false) {
$slack->attach([
'fallback' => "{$ratingText} {$review['author']['name']}: {$review['title']}{$review['content']}",
'fallback' => "{$ratingText} {$review['title']}{$review['content']}",
'author_name' => $review['application']['name'],
'author_icon' => $review['application']['image'],
'author_link' => $review['application']['link'],
'color' => ($review['rating'] >= 4) ? 'good' : (($review['rating'] == 3) ? 'warning' : 'danger'),
'pretext' => "{$ratingText} Review for {$review['application']['version']} from <{$review['author']['uri']}|{$review['author']['name']}> ({$review['country']})",
'fields' => [
[
'title' => $review['title'],
'value' => $review['content']
],
[
'title' => 'Rating',
'value' => $ratingText,
'short' => true
],
[
'title' => 'Author',
'value' => "<{$review['author']['uri']}|{$review['author']['name']}>",
'short' => true
],
[
'title' => 'Version',
'value' => $review['application']['version'],
'short' => true
],
[
'title' => 'Country',
'value' => $review['country'],
'short' => true
]
]
])->send();
Expand Down

0 comments on commit 502186b

Please sign in to comment.