Skip to content

Commit f664706

Browse files
committed
minor #51158 [Notifier] [Docs] Fix update slack messages documentation (franmomu)
This PR was merged into the 6.3 branch. Discussion ---------- [Notifier] [Docs] Fix update slack messages documentation | Q | A | ------------- | --- | Branch? | 6.3 <!-- see below --> | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> `UpdateMessageSlackOptions` receives a channel id and message id: https://github.com/symfony/symfony/blob/4c1d9533355d66380e3f0fed774ebf38c601aab1/src/Symfony/Component/Notifier/Bridge/Slack/UpdateMessageSlackOptions.php#L19 The method `getFullMessageId()` does not exists, it is `getMessageId()` https://github.com/symfony/symfony/blob/4c1d9533355d66380e3f0fed774ebf38c601aab1/src/Symfony/Component/Notifier/Message/SentMessage.php#L44 Commits ------- d4fd147 Fix update slack messages documentation
2 parents 33ccacc + d4fd147 commit f664706

File tree

1 file changed

+5
-4
lines changed
  • src/Symfony/Component/Notifier/Bridge/Slack

1 file changed

+5
-4
lines changed

src/Symfony/Component/Notifier/Bridge/Slack/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ $chatter->send($chatMessage);
200200
Updating a Slack Message
201201
------------------------
202202

203-
First, save the full message ID when sending a message:
203+
First, save the message ID and channel ID when sending a message:
204204

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

211211
// Make sure that Slack transport was used
212212
if ($sentMessage instanceOf SlackSentMessage) {
213-
$fullMessageId = $sentMessage->getFullMessageId();
213+
$messageId = $sentMessage->getMessageId();
214+
$channelId = $sentMessage->getChannelId();
214215
}
215216
```
216217

217-
Then, use that full message ID to create a new
218+
Then, use that message ID and channel ID to create a new
218219
``UpdateMessageSlackOptions`` class:
219220

220221
```php
221222
use Symfony\Component\Notifier\Bridge\Slack\UpdateMessageSlackOptions;
222223
use Symfony\Component\Notifier\Message\ChatMessage;
223224

224-
$options = new UpdateMessageSlackOptions($fullMessageId);
225+
$options = new UpdateMessageSlackOptions($channelId, $messageId);
225226
$chatter->send(new ChatMessage('Updated message', $options));
226227
```
227228

0 commit comments

Comments
 (0)