From 502186b0549941637277f439541f875270150f0d Mon Sep 17 00:00:00 2001 From: Ilya Chekalskiy Date: Thu, 4 Jun 2015 11:56:26 +0300 Subject: [PATCH] Make slack message more accurate --- src/Reviewer.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Reviewer.php b/src/Reviewer.php index e090977..cb2c382 100755 --- a/src/Reviewer.php +++ b/src/Reviewer.php @@ -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();