use NotificationChannels\MsTeams\MsTeamsChannel;
use NotificationChannels\MsTeams\MsTeamsMessage;
use Illuminate\Notifications\Notification;
class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [MsTeamsChannel::class];
}
public function toMsTeams($notifiable)
{
$url = url('/invoice/' . $this->invoice->id);
return MsTeamsMessage::create()
// Optional recipient user id.
->to(config('services.ms-teams.webhook_url'))
// Markdown supported.
->content("Hello there!\nYour invoice has been *PAID*")
// (Optional) Inline Buttons
->button('View Invoice', $url)
->button('Download Invoice', $url)
// (Optional) Supporting images
->image('https://source.unsplash.com/random/800x800?animals,nature&q='.now())
->image('https://source.unsplash.com/random/900x600?building,car&q='.now());
}
}
...
/**
* Route notifications for the MS Teams channel.
*
* @return int
*/
public function routeNotificationForMsTeams()
{
return config('services.ms-teams.webhook_url');
}
...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.