Skip to content
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

[Notifier] Allow to update Slack messages #47349

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

maxim-dovydenok
Copy link
Contributor

@maxim-dovydenok maxim-dovydenok commented Aug 20, 2022

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:

// 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())));

@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@maxim-dovydenok
Copy link
Contributor Author

Hello, do I need to do anything else to get a review? Or it's just in the queue?

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

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks. I just pushed some changes to make the API a bit more DX-friendly hopefully.

@nicolas-grekas
Copy link
Member

Thank you @shiftby.

@nicolas-grekas nicolas-grekas merged commit 68725da into symfony:6.3 Dec 16, 2022
@fabpot fabpot mentioned this pull request May 1, 2023
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.

[Notifier] Allow to update Slack messages using the same transport
5 participants