Skip to content

[Notifier] Add Update slack message article #17214

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

Closed

Conversation

maxim-dovydenok
Copy link

No description provided.

@carsonbot carsonbot added this to the 6.2 milestone Aug 20, 2022
@wouterj wouterj modified the milestones: 6.2, next Oct 23, 2022
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Dec 16, 2022
…enok-busuu)

This PR was merged into the 6.3 branch.

Discussion
----------

[Notifier] Allow to update Slack messages

Update existing SlackTransport to allow message updates. Because chat.update API method only allows channel ids, this PR also includes updates to SentMessage

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #47274
| License       | MIT
| Doc PR        | symfony/symfony-docs#17214

This pull request allows to update slack messages, for example to keep entity statuses up-to-date:
```php
// On entity creation
$message = sprintf('Entity #%s (%s)', $entity->getId(), $entity->getStatus());
$sentMessage = $this->chatter->send(new ChatMessage($message));

// On status changes
$message = sprintf('Entity #%s (%s)', $entity->getId(), $entity->getStatus());
$this->chatter->send(new ChatMessage($message, new UpdateMessageSlackOptions($sentMessage->getFullMessageId())));
```

Commits
-------

e410909 [Notifier] Allow to update Slack messages
@javiereguiluz javiereguiluz modified the milestones: next, 6.3 Jun 6, 2023
@javiereguiluz javiereguiluz force-pushed the slack-update-message branch from 3257bb4 to 7653443 Compare June 6, 2023 15:16
@javiereguiluz
Copy link
Member

Maxim, thanks and congrats on your first Symfony Docs contribution 🎉

GitHub shows this PR as "closed", but it was merged. Thanks!

@javiereguiluz
Copy link
Member

Update: since this PR was created, we removed the docs about each notifier from this repository and moved them to the symfony/symfony repository. So, I've recreated your changes in this PR: symfony/symfony#50581

nicolas-grekas added a commit to symfony/symfony that referenced this pull request Jun 8, 2023
…reguiluz)

This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

[Notifier] Add docs about updating Slack messages

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

These are the docs created by `@maxim`-dovydenok to document this feature in symfony/symfony-docs#17214

Commits
-------

6f72d4f [Notifier] Add docs about updating Slack messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants