Skip to content

[Notifier] [Docs] Fix update slack messages documentation #51158

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
Jul 30, 2023
Merged
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
9 changes: 5 additions & 4 deletions src/Symfony/Component/Notifier/Bridge/Slack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ $chatter->send($chatMessage);
Updating a Slack Message
------------------------

First, save the full message ID when sending a message:
First, save the message ID and channel ID when sending a message:

```php
use Symfony\Component\Notifier\Bridge\Slack\SlackSentMessage;
Expand All @@ -210,18 +210,19 @@ $sentMessage = $chatter->send(new ChatMessage('Original message'));

// Make sure that Slack transport was used
if ($sentMessage instanceOf SlackSentMessage) {
$fullMessageId = $sentMessage->getFullMessageId();
$messageId = $sentMessage->getMessageId();
$channelId = $sentMessage->getChannelId();
}
```

Then, use that full message ID to create a new
Then, use that message ID and channel ID to create a new
``UpdateMessageSlackOptions`` class:

```php
use Symfony\Component\Notifier\Bridge\Slack\UpdateMessageSlackOptions;
use Symfony\Component\Notifier\Message\ChatMessage;

$options = new UpdateMessageSlackOptions($fullMessageId);
$options = new UpdateMessageSlackOptions($channelId, $messageId);
$chatter->send(new ChatMessage('Updated message', $options));
```

Expand Down