Slack notifications with markdown styling don't work. The documentation isn't super clear about how to do it, but I've tried just about every combination I can think of and each time it produces a slack notification but doesn't actually use the markdown formatting.
To keep this simple...
I've tried the exact example from the documentation
public function toSlack($notifiable)
{
$url = url('/exceptions/'.$this->exception->id);
return (new SlackMessage)
->error()
->content('Whoops! Something went wrong.')
->attachment(function ($attachment) use ($url) {
$attachment->title('Exception: File Not Found', $url)
->content('File [background.jpg] was **not found**.')
->markdown(['title', 'text']);
});
}
and it doesn't produce the bold around "not found". I've also tried actually adding a field called "title" and a field called "text" but it has no affect on the markdown contained in those fields.
That should be content('File [background.jpg] was *not found**') with a single * around the text you want to make bold, will correct the docs :)
Most helpful comment
That should be
content('File [background.jpg] was *not found**')with a single*around the text you want to make bold, will correct the docs :)