laravel / slack-notification-channel

Slack Notification Channel for laravel.
https://laravel.com/docs/notifications#slack-notifications
MIT License
870 stars 61 forks source link

slack warning message #16

Closed ghost closed 5 years ago

ghost commented 5 years ago

I am using laravel version 5.8. What is the proper way to send a warning message to slack? The following code does not generate a warning message...

public function toSlack($notifiable)
    {
        return (new SlackMessage)
            ->content('One of your invoices has been paid!')
            ->warning();
    }
nathanheffley commented 5 years ago

I don't believe that Slack messages themselves actually use the color setting. Only Slack attachments use it: https://api.slack.com/docs/message-attachments

If you change your content to be in an attachment instead, it should show up with the colored bar on the left like you're probably expecting. Attachments can have their own color set specifically, otherwise they will use the color set on the message.