You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Bridge/Mercure/README.md
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,34 @@ where:
14
14
-`HUB_ID` is the Mercure hub id
15
15
-`TOPIC` is the topic IRI (optional, default: `https://symfony.com/notifier`. Could be either a single topic: `topic=https://foo` or multiple topics: `topic[]=/foo/1&topic[]=https://bar`)
16
16
17
+
18
+
Adding Options to a Chat Message
19
+
--------------------------------
20
+
21
+
With a Mercure Chat Message, you can use the `MercureOptions` class to add
22
+
message options.
23
+
24
+
```php
25
+
use Symfony\Component\Notifier\Message\ChatMessage;
26
+
use Symfony\Component\Notifier\Bridge\Mercure\MercureOptions;
27
+
28
+
$chatMessage = new ChatMessage('Contribute To Symfony');
29
+
30
+
$options = new MercureOptions(
31
+
['/topic/1', '/topic/2'],
32
+
true,
33
+
'id',
34
+
'type',
35
+
1,
36
+
['tag' => '1234', 'body' => 'TEST']
37
+
);
38
+
39
+
// Add the custom options to the chat message and send the message
0 commit comments