8000 [Notifier] Mention `postAt()` in the Slack bridge README · symfony/symfony@d46ebaa · GitHub
[go: up one dir, main page]

Skip to content

Commit d46ebaa

Browse files
[Notifier] Mention postAt() in the Slack bridge README
1 parent 5973047 commit d46ebaa

File tree

1 file changed

+22
-2
lines changed
  • src/Symfony/Component/Notifier/Bridge/Slack

1 file changed

+22
-2
lines changed

src/Symfony/Component/Notifier/Bridge/Slack/README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SLACK_DSN=slack://xoxb-......@default?channel=fabien
2929
Adding Interactions to a Message
3030
--------------------------------
3131

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
3333
interactive options called [Block elements](https://api.slack.com/reference/block-kit/block-elements).
3434

3535
```php
@@ -177,7 +177,7 @@ $chatter->send($chatMessage);
177177
Sending a Message as a Reply
178178
----------------------------
179179

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.
181181

182182
```php
183183
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackSectionBlock;
@@ -226,6 +226,26 @@ $options = new UpdateMessageSlackOptions($channelId, $messageId);
226226
$chatter->send(new ChatMessage('Updated message', $options));
227227
```
228228

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+
229249
Resources
230250
---------
231251

0 commit comments

Comments
 (0)
0