Framework: Slack notifications with markdown styling do not work

Created on 26 Mar 2017  路  1Comment  路  Source: laravel/framework

  • Laravel Version: v5.4.16
  • PHP Version: v7.0.15-0ubuntu0.16.04.4
  • Database Driver & Version: mysql Ver 15.1 Distrib 10.0.29-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Description:

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.

Steps To Reproduce:

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.

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 :)

>All comments

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 :)

Was this page helpful?
0 / 5 - 0 ratings