8000 minor #53143 [Notifier] Mention `postAt()` in the Slack bridge README… · symfony/symfony@024ad06 · GitHub
[go: up one dir, main page]

Skip to content

Commit 024ad06

Browse files
committed
minor #53143 [Notifier] Mention postAt() in the Slack bridge README (alexandre-daubois)
This PR was merged into the 6.4 branch. Discussion ---------- [Notifier] Mention `postAt()` in the Slack bridge README | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix symfony/symfony-docs#18958 | License | MIT Commits ------- f49db94 [Notifier] Mention `postAt()` in the Slack bridge README
2 parents 5973047 + f49db94 commit 024ad06

File tree

1 file changed

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

1 file changed

+19
-2
lines changed

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

Lines changed: 19 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,23 @@ $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\SlackOptions;
236+
use Symfony\Component\Notifier\Message\ChatMessage;
237+
238+
$options = (new SlackOptions())->postAt(new \DateTime('+1 day'));
239+
240+
$chatMessage = new ChatMessage('Symfony Feature');
241+
$chatMessage->options($options);
242+
243+
$chatter->send($chatMessage);
244+
```
245+
229246
Resources
230247
---------
231248

0 commit comments

Comments
 (0)
0