Download the PHP package tob0t/laravel-notification-channel-teams without Composer
On this page you can find all versions of the php package tob0t/laravel-notification-channel-teams. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tob0t/laravel-notification-channel-teams
More information about tob0t/laravel-notification-channel-teams
Files in tob0t/laravel-notification-channel-teams
Package laravel-notification-channel-teams
Short Description A Laravel Notification Channel for Microsoft Teams
License MIT
Homepage https://github.com/Tob0t/laravel-notification-channel-teams
Informations about the package laravel-notification-channel-teams
Microsoft Teams Notifications Channel for Laravel (Moved)
I am happy to announce that this repo was officially accepted by Laravel Notification Channels and now can be found under https://github.com/laravel-notification-channels/microsoft-teams. Please do not use this repo anymore, as I will archive this repo soon.
This package makes it easy to send notifications using Microsoft Teams with Laravel 5.5+, 6.x and 7.x
Contents
- Installation
- Setting up the Connector
- Setting up the MicrosoftTeams service
- Usage
- Available Message methods
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install the package via composer:
Setting up the Connector
Please check out this for setting up and adding a webhook connector to your Team's channel. Basic Markdown is supported, please also check out the message card reference article which goes in more detail about the do's and don'ts.
Setting up the MicrosoftTeams service
Then, configure your webhook url:
Add the following code to your config/services.php
:
You can also add multiple webhooks if you have multiple teams or channels, it's up to you.
Usage
Now you can use the channel in your via()
method inside the notification:
Instead of adding the to($url)
method for the recipient you can also add the routeNotificationForMicrosoftTeams
method inside your Notifiable model. This method needs to return the webhook url.
Available Message methods
to(string $webhookUrl)
: Recipient's webhook url.title(string $title)
: Title of the message.summary(string $summary)
: Summary of the message.type(string $type)
: Type which is used as theme color (any valid hex code or one of: primary|secondary|accent|error|info|success|warning).content(string $content)
: Content of the message (Markdown supported).button(string $text, string $url = '', array $params = [])
: Text and url of a button. Wrapper for an potential action.action(string $text, $type = 'OpenUri', array $params = [])
: Text and type for a potential action. Further params can be added depending on the action. For more infos about different types check out this link.options(array $options, $sectionId = null)
: Add additional options to pass to the message payload object.
Sections
It is possible to define one or many sections inside a message card. The following methods can be used within a section
addStartGroupToSection($sectionId = 'standard_section')
: Add a startGroup property which marks the start of a logical group of information.activity(string $activityImage = '', string $activityTitle = '', string $activitySubtitle = '', string $activityText = '', $sectionId = 'standard_section')
: Add an activity to a section.fact(string $name, string $value, $sectionId = 'standard_section')
: Add a fact to a section (Supports Markdown).image(string $imageUri, string $title = '', $sectionId = 'standard_section')
: Add an image to a section.heroImage(string $imageUri, string $title = '', $sectionId = 'standard_section')
: Add a hero image to a section.
Additionally the title, content, button and action can be also added to a section through the optional params
value:
title(string $title, array $params = ['section' => 'my-section'])
: Title of the message and add it tomy-section
.content(string $content, array $params = ['section' => 'my-section'])
: Content of the message and add it tomy-section
(Markdown supported).button(string $text, string $url = '', array $params = ['section' => 'my-section'])
: Text and url of a button and add it tomy-section
.action(string $text, $type = 'OpenUri', array $params = ['section' => 'my-section'])
: Text and type of an potential action and add it tomy-section
.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Tobias Madner
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-notification-channel-teams with dependencies
guzzlehttp/guzzle Version ^6.5
illuminate/notifications Version ~5.5 || ~6.0 || ~7.0
illuminate/support Version ~5.5 || ~6.0 || ~7.0