Skip to content

[Notifier] Allow to update Slack messages using the same transport #47274

Closed
@maxim-dovydenok

Description

@maxim-dovydenok

Description

Current SlackTransport implementation has API method hardcoded: chat.postMessage

        $response = $this->client->request('POST', 'https://'.$this->getEndpoint().'/api/chat.postMessage', [
            'json' => array_filter($options),
            'auth_bearer' => $this->accessToken,
            'headers' => [
                'Content-Type' => 'application/json; charset=utf-8',
            ],
        ]);

chat.update API method requires 2 parameters: transport (already available in SlackOptions) and ts (should be added).
Then based on these options API method can be selected.

This feature can be used to update slack messages on entity status updates, etc. For example SentMessage id can be saved in the database when message is first sent to the slack, and later can be used to update the same message.

WDYT?

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions