Skip to content

Commit 4bc5c6e

Browse files
author
dani
committed
master - update slack notification message shape
1 parent a3e8771 commit 4bc5c6e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/NotificationService.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,24 @@ public static function sendSlackNotification($message)
5454
return;
5555
}
5656

57-
// Prepare the data to be sent in the request body
58-
$data = ['text' => $message];
57+
// Prepare the data for the request
58+
$data = [
59+
'text' => config('log-alarm.notification_email_subject') ,
60+
'attachments' => [
61+
[
62+
'title' => config('log-alarm.notification_email_subject'),
63+
'text' => $message,
64+
'color' => '#FF0000',
65+
'fields' => [
66+
[
67+
'title' => 'Priority',
68+
'value' => 'High',
69+
'short' => true
70+
]
71+
]
72+
]
73+
]
74+
];
5975

6076
// Initialize the cURL session
6177
$ch = curl_init($webhookUrl);

0 commit comments

Comments
 (0)