Opscale\NotificationCenter\Notifications\TeamsNotificationChannel identifier:
teamsUnderlying driver:
NotificationChannels\MicrosoftTeams\MicrosoftTeamsChannelProvider: Microsoft Teams
TeamsNotification posts an Adaptive Card to a Microsoft Teams channel using the laravel-notification-channels/microsoft-teams package and an incoming webhook URL.
Requirements
The
laravel-notification-channels/microsoft-teams Composer package must be installed. An incoming webhook URL must be configured for the target Teams channel.Method signatures
via()
Returns [MicrosoftTeamsChannel::class], routing the notification through the Microsoft Teams channel.
toMicrosoftTeams(object $notifiable): MicrosoftTeamsAdaptiveCard
Builds and returns a NotificationChannels\MicrosoftTeams\MicrosoftTeamsAdaptiveCard. The card is composed of:
Set to
$delivery->notification->subject.An array containing a single
TextBlock element whose text is $delivery->notification->summary if set, otherwise $delivery->notification->subject. The text block has isSubtle set to true.An array containing a single
ActionOpenUrl element titled “View” with the delivery’s tracked open URL.What data it sends
The Adaptive Card posted to Teams contains:| Element | Value |
|---|---|
| Card title | Notification subject |
| Body text block | Notification summary (falls back to subject if absent), rendered as subtle text |
| Action button | ”View” — opens the tracked open URL in a browser |
Usage example
Addteams to a strategy’s channels array:
routeNotificationForMicrosoftTeams() returning the incoming webhook URL for the target channel: