Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Notifier] Add docs for Microsoft Teams Options#15232

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Changes fromall 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
38 changes: 38 additions & 0 deletionsnotifier/chatters.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -218,6 +218,44 @@ to add `message options`_::

$chatter->send($chatMessage);

Adding Options to a Microsoft Teams Message
-------------------------------------------

With a Microsoft Teams message, you can use the
:class:`Symfony\\Component\\Notifier\\Bridge\\MicrosoftTeams\\MicrosoftTeamsOptions` class
to add `options`_::

use Symfony\Component\Notifier\Bridge\MicrosoftTeams\MicrosoftTeamsOptions;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Section\Field\Image;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Section\Section;
use Symfony\Component\Notifier\Message\ChatMessage;

$chatMessage = new ChatMessage('');

// Create MicrosoftTeams options
$options = (new MicrosoftTeamsOptions())
->title('Hey all!')
->summary('**A big thank you**') // you can use Markdown here
->text('Lets celebrate the release of Symfony 5.3 all together!')
->themeColor('FF0000');

$options->section((new Section())
->image((new Image())
->image('https://symfony.com/logo.png')
->title('The Symfony Logo')
)
);

// Add the custom options to the chat message and send the message
$chatMessage->options($options);

$chatter->send($chatMessage);

.. versionadded:: 5.3

Options for Microsoft Teams were introduced in Symfony 5.3.

.. _`Block elements`: https://api.slack.com/reference/block-kit/block-elements
.. _`Embed elements`: https://discord.com/developers/docs/resources/webhook
.. _`message options`: https://core.telegram.org/bots/api
.. _`options`: https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference

[8]ページ先頭

©2009-2025 Movatter.jp