-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft Adaptive Cards #1
Conversation
Should we completely remove the Microsoft Messages too as it's not used anymore? |
Should we keep the enums I added too? I was thinking it would be good to know what values are allowed for each property to minimise errors thrown by wrong types/naming. There maybe a better way to implement the allowed property types then enums? |
The package must support PHP >7.2, so we won't be able to use Enums:
If it's not used anymore, then yes. |
* | ||
* @return array | ||
*/ | ||
public function toArray() : array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we update our toArray
methods in all of these classes to be less dynamic:
return [
'facts' => $this->facts->toArray(),
...
];
We can leave the MicrosoftTeamsAdaptiveCard
as is because it follows the project pattern of using payload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated methods
The original https://github.com/laravel-notification-channels/microsoft-teams package is an out of date package.
With the connectors being deprecated. Issue = laravel-notification-channels#30
There is a suggested fix with issue: laravel-notification-channels#31
This fix is out of date with it being version 1.2 and when tried and tested doesn't actually work.
This PR fixes the issue with a new Microsoft Adaptive Card Class. The Adaptive Cards replace the messages.
This PR includes Text Blocks, Icon Block, FactSets and Action Url Button with the ability to customise them too.
The blocks are based on the components from https://dev.teams.microsoft.com/cards/new?cardName=test
To test this out, I created a Laravel 10 test project.
Added this to composer.json
set "minimum-stability": "dev", in composer.json
and set in composer.json
In the .env I set TEAMS_WEBHOOK_URL=
Then in services.php I set
Then in a controller action I set
and create a notification to be run from the controller action. Notification class =