@@ -29,7 +29,7 @@ SLACK_DSN=slack://xoxb-......@default?channel=fabien
29
29
Adding Interactions to a Message
30
30
--------------------------------
31
31
32
- With a Slack message, you can use the ` SlackOptions ` class to add some
32
+ With a Slack message, you can use the ` SlackOptions ` class to add some
33
33
interactive options called [ Block elements] ( https://api.slack.com/reference/block-kit/block-elements ) .
34
34
35
35
``` php
@@ -177,7 +177,7 @@ $chatter->send($chatMessage);
177
177
Sending a Message as a Reply
178
178
----------------------------
179
179
180
- To send your slack message as a reply in a thread use the ` threadTs() ` method.
180
+ To send your Slack message as a reply in a thread use the ` threadTs() ` method.
181
181
182
182
``` php
183
183
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackSectionBlock;
@@ -226,6 +226,26 @@ $options = new UpdateMessageSlackOptions($channelId, $messageId);
226
226
$chatter->send(new ChatMessage('Updated message', $options));
227
227
```
228
228
229
+ Scheduling a Slack Message
230
+ --------------------------
231
+
232
+ To schedule a message to be sent at a later time, use the ` postAt() ` method:
233
+
234
+ ``` php
235
+ use Symfony\Component\Notifier\Bridge\Slack\Block\SlackSectionBlock;
236
+ use Symfony\Component\Notifier\Bridge\Slack\SlackOptions;
237
+ use Symfony\Component\Notifier\Message\ChatMessage;
238
+
239
+ $chatMessage = new ChatMessage('Symfony Feature');
240
+
241
+ $options = (new SlackOptions())->postAt(new \DateTime('+1 day'));
242
+
243
+ // Add the custom options to the chat message and schedule the message
244
+ $chatMessage->options($options);
245
+
246
+ $chatter->send($chatMessage);
247
+ ```
248
+
229
249
Resources
230
250
---------
231
251
0 commit comments