Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skrepr/teams-connector
This package allows you to send notifications to Microsoft Teams.
https://github.com/skrepr/teams-connector
composer microsoft packagist php teams
Last synced: 3 days ago
JSON representation
This package allows you to send notifications to Microsoft Teams.
- Host: GitHub
- URL: https://github.com/skrepr/teams-connector
- Owner: skrepr
- License: mit
- Created: 2021-10-07T13:14:23.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-09T17:10:47.000Z (almost 2 years ago)
- Last Synced: 2024-11-01T10:17:42.609Z (13 days ago)
- Topics: composer, microsoft, packagist, php, teams
- Language: PHP
- Homepage: https://packagist.org/packages/skrepr/teams-connector
- Size: 29.3 KB
- Stars: 22
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
Teams connector
This package allows you to send notifications to Microsoft Teams.
## Installation
You can install the package using the [Composer](https://getcomposer.org/) package manager. You can install it by running this command in your project root:
```sh
composer require skrepr/teams-connector
```Then [create an incoming webhook](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) on your Microsoft teams channel for the package to use.
## Basic Usage
### Create a simple card
```php
setText('Yes, he did')
->setThemeColor(CardInterface::STATUS_DEFAULT)
->setTitle('Adding Title to the card');$teamsClient->send($card);
```### Adding a section
```php
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);
$teamsClient->send($card);
```### Adding actions and inputs to the card
```php
setText('Yes, he did');$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);
$teamsClient->send($card);
```### 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](https://packagist.org/providers/php-http/client-implementation).## Testing
``` bash
composer test
```## Credits
- [Skrepr](https://skrepr.com)
- [Evert Jan Hakvoort](https://github.com/EJTJ3)
- [Jon Mulder](https://github.com/jonmldr)
- [All Contributors](../../contributors)## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.