This package allows you to send notifications to Microsoft Teams.

Last update: May 6, 2022

skrepr

Teams connector

Releases LICENSE Issues PR Commits Stars Forks

This package allows you to send notifications to Microsoft Teams.

Installation

You can install the package using the Composer package manager. You can install it by running this command in your project root:

composer require skrepr/teams-connector

Then create an incoming webhook on your Microsoft teams channel for the package to use.

Basic Usage

Create a simple card



declare(strict_types=1);

use Skrepr\TeamsConnector\Card;
use Skrepr\TeamsConnector\Client;

$endPoint = 'https://...';
$httpClient = new \GuzzleHttp\Client();
$teamsClient = new Client($endPoint, $httpClient);

$card = (new Card('Larry Bryant created a new task'))
    ->setText('Yes, he did')
    ->setThemeColor(CardInterface::STATUS_DEFAULT)
    ->setTitle('Adding Title to the card');

$teamsClient->send($card);

Adding a section



declare(strict_types=1);

use Skrepr\TeamsConnector\Card;
use Skrepr\TeamsConnector\Section;

$card = new Card('Larry Bryant created a new task');

$section = (new Section('![TestImage](https://47a92947.ngrok.io/Content/Images/default.png)Larry Bryant created a new task'))
    ->setActivitySubtitle('On Project Tango')
    ->setActivityImage('https://teamsnodesample.azurewebsites.net/static/img/image5.png')
    ->addFact('Assigned to', 'Unassigned')
    ->addFact('Due date', 'Mon May 01 2017 17:07:18 GMT-0700 (Pacific Daylight Time)');

$card->addSection($section);

Adding actions and inputs to the card



declare(strict_types=1);

use Skrepr\TeamsConnector\Card;
use Skrepr\TeamsConnector\Actions\ActionCard;
use Skrepr\TeamsConnector\Actions\HttpPostAction;
use Skrepr\TeamsConnector\Inputs\TextInput;

$card = new Card('Larry Bryant created a new task');

$actionCard = (new ActionCard('Add a comment'))
    ->addInput(new TextInput('comment', 'Add a comment here for this task'))
    ->addAction(new HttpPostAction('Add comment', 'http://...'));

$card->addPotentialAction($actionCard);

HTTP Clients

In order to talk to Microsoft Teams API, you need an HTTP adapter. We rely on HTTPlug which defines how HTTP message should be sent and received. You can use any library to send HTTP messages that implements php-http/client-implementation.

Testing

composer test

Credits

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.

GitHub

https://github.com/skrepr/teams-connector
You might also like...

Standalone PHP library for easy devices notifications push.

NotificationPusher Standalone PHP library for easy devices message notifications push. Feel free to contribute! Thanks. Contributors Cédric Dugat (Aut

May 9, 2022

A very lightweight library to handle notifications the smart way.

A very lightweight library to handle notifications the smart way.

NAMSHI | Notificator Notificator is a very simple and lightweight library to handle notifications the smart way. It took inspiration from other librar

May 9, 2022

Takes care of Apple push notifications (APNS) in your PHP projects.

Notificato Notificato takes care of push notifications in your PHP projects. Italian: notificato è: participio passato English: notified Why use Notif

Apr 17, 2022

Sends notifications via one or more channels (email, SMS, ...).

Notifier Component The Notifier component sends notifications via one or more channels (email, SMS, ...). Resources Documentation Contributing Report

May 21, 2022

Laravel Security Notifications

This package adds security notifications to warn your users when significant security events occur so that they aren't the next victim of an attacker.

Feb 8, 2022

Laravel Subscribable Notifications

Laravel Subscribable Notifications This package allows you to subscribe your app Users to your app Notifications and dispatch them without specifying

Mar 18, 2022

Push notifications Library for PHP

Push notifications Library for PHP Supported Protocols Protocol Supported Driver Options APNs (Token Based) ✓ APNs\Token APNs\Token\Option APNs (Certi

Mar 25, 2022

Flexible Flash notifications for Laravel

Flexible Flash notifications for Laravel

Introduction Laravel Notify is a package that lets you add custom notifications to your project. A diverse range of notification design is available.

May 23, 2022

📨 Facebook Notifications Channel for Laravel

📨 Facebook Notifications Channel for Laravel

Facebook Notifications Channel for Laravel This package makes it easy to send notifications using the Facebook Messenger with Laravel. Contents Instal

Apr 13, 2022
:computer: Send notifications to your desktop directly from your PHP script
:computer: Send notifications to your desktop directly from your PHP script

About JoliNotif JoliNotif is a cross-platform PHP library to display desktop notifications. It works on Linux, Windows or MacOS. Requires PHP >= 7.2 (

May 12, 2022
A PHP Library to easily send push notifications with the Pushwoosh REST Web Services.

php-pushwoosh A PHP Library to easily send push notifications with the Pushwoosh REST Web Services. First sample, creating a Pushwoosh message // Crea

Jan 27, 2022
Notifications in PHP (notify-send, growl, etc) like that.

#Nod Notifications in PHP (notify-send, growl, etc) like that. ##Examples Letting Nod figure out the best Adapter to use (not recommend ATM, only work

Mar 26, 2019
Send push notifications to apple devices (iPhone, iPad, iPod).

Apple Apn Push Send push notifications to apple devices (iPhone, iPad, iPod). Support authenticators: Certificate Json Web Token Supported protocols:

Apr 26, 2022
Send Firebase push notifications with Laravel php framework.

FCM Notification Channel for Laravel Send Firebase push notifications with Laravel php framework. Installation You can install this package via compos

May 21, 2022
WebPush can be used to send notifications to endpoints which server delivers Web Push

WebPush can be used to send notifications to endpoints which server delivers Web Push notifications as described in the Web Push protocol. As it is standardized, you don't have to worry about what server type it relies on.

May 12, 2022
Laravel SMS allows you to send SMS from your Laravel application using multiple sms providers, allow to add custom sms provider

Laravel SMS Laravel SMS allows you to send SMS from your Laravel application using multiple sms providers, allow to add custom sms provider Requiremen

May 7, 2022
Laravel package to launch toast notifications.
Laravel package to launch toast notifications.

Laravel package to launch toast notifications. This package provides assistance when using toast notifications. Using the iziTOAST package, which allo

Mar 14, 2022
A package to simplify automating future notifications and reminders in Laravel
A package to simplify automating future notifications and reminders in Laravel

Laravel Snooze Schedule future notifications and reminders in Laravel Why use this package? Ever wanted to schedule a future notification to go out at

May 11, 2022
Laravel package to enable sending push notifications to devices

Laravel Push Notification Package to enable sending push notifications to devices Installation Update your composer.json file to include this package

Apr 25, 2022