Skip to content

Commit d7007d7

Browse files
committed
bug #40834 [Notifier] Microsoft Teams: JSON structure error fix for simple message (KamilKubicki)
This PR was merged into the 5.3-dev branch. Discussion ---------- [Notifier] Microsoft Teams: JSON structure error fix for simple message Code caused following error - 'Unable to post the Microsoft Teams message: ... Summary or Text is required. '. The structure of the message should contain the 'text' attribute instead of 'title'. | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix | License | MIT Commits ------- 636dfc6 [Notifier] Microsoft Teams: JSON structure error fix for simple message
2 parents 1ca10f5 + 636dfc6 commit d7007d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/MicrosoftTeamsTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function doSend(MessageInterface $message): SentMessage
6060
$endpoint = sprintf('https://%s%s', $this->getEndpoint(), $path);
6161
$response = $this->client->request('POST', $endpoint, [
6262
'json' => [
63-
'title' => $message->getSubject(),
63+
'text' => $message->getSubject(),
6464
],
6565
]);
6666

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Tests/MicrosoftTeamsTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function testSend()
7979
{
8080
$message = 'testMessage';
8181

82-
$expectedBody = json_encode(['title' => $message]);
82+
$expectedBody = json_encode(['text' => $message]);
8383

8484
$client = new MockHttpClient(function (string $method, string $url, array $options = []) use ($expectedBody): ResponseInterface {
8585
$this->assertJsonStringEqualsJsonString($expectedBody, $options['body']);

0 commit comments

Comments
 (0)