8000 [Notifier] Add options to Microsoft Teams notifier by OskarStark · Pull Request #40738 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Notifier] Add options to Microsoft Teams notifier #40738

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

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action;

use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\Input\InputInterface;

/**
* @author Edouard Lescot <edouard.lescot@gmail.com>
* @author Oskar Stark <oskarstark@googlemail.com>
*
* @see https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#actioncard-action
*/
final class ActionCard implements ActionInterface
{
private $options = [];

public function name(string $name): self
{
$this->options['name'] = $name;

return $this;
}

public function input(InputInterface $inputAction): self
{
$this->options['inputs'][] = $inputAction->toArray();

return $this;
}
< 8000 span class='blob-code-inner blob-code-marker ' data-code-marker="+">
public function action(ActionCardCompatibleActionInterface $action): self
{
$this->options['actions'][] = $action->toArray();

return $this;
}

public function toArray(): array
{
return $this->options + ['@type' => 'ActionCard'];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action;

/**
* An Action which can be used inside an ActionCard.
*
* @author Oskar Stark <oskarstark@googlemail.com>
*/
interface ActionCardCompatibleActionInterface extends ActionInterface
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action;

/**
* @author Edouard Lescot <edouard.lescot@gmail.com>
* @author Oskar Stark <oskarstark@googlemail.com>
*/
interface ActionInterface
{
public function toArray(): array;
}