File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -131,10 +131,41 @@ The result will be something like:
131
131
.. image :: /_images/notifier/slack/field-method.png
132
132
:align: center
133
133
134
- .. versionadded :: 5.1
134
+ .. versionadded :: 5.3
135
135
136
136
The `field() ` method was introduced in Symfony 5.1.
137
137
138
+ Sending a Slack Message as a reply
139
+ -------------------------------------------
140
+
141
+ To send your slack message as a reply in a thread you can use the
142
+ :method: `SlackOptions::threadTs() <Symfony\\ Component\\ Notifier\\ Bridge\\ Slack\\ SlackOptions::threadTs> ` method::
143
+
144
+ use Symfony\Component\Notifier\Bridge\Slack\Block\SlackSectionBlock;
145
+ use Symfony\Component\Notifier\Bridge\Slack\SlackOptions;
146
+ use Symfony\Component\Notifier\Message\ChatMessage;
147
+
148
+ $chatMessage = new ChatMessage('Symfony Feature');
149
+
150
+ $options = (new SlackOptions())
151
+ ->block((new SlackSectionBlock())->text('My reply'))
152
+ ->threadTs('1621592155.003100')
153
+ ;
154
+
155
+ // Add the custom options to the chat message and send the message
156
+ $chatMessage->options($options);
157
+
158
+ $chatter->send($chatMessage);
159
+
160
+ The result will be something like:
161
+
162
+ .. image :: /_images/notifier/slack/message-reply.png
163
+ :align: center
164
+
165
+ .. versionadded :: 5.3
166
+
167
+ The `threadTs() ` method was introduced in Symfony 5.3.
168
+
138
169
Adding Interactions to a Discord Message
139
170
----------------------------------------
140
171
You can’t perform that action at this time.
0 commit comments