8000 minor #50379 [Notifier] Document Notifier options in README files 5.4… · symfony/symfony@6f13a09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f13a09

Browse files
minor #50379 [Notifier] Document Notifier options in README files 5.4 (alamirault)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Notifier] Document Notifier options in README files 5.4 | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Continue #50349 on 5.4 branch Commits ------- b670273 [Notifier] Document Notifier options in README files 5.4
2 parents d189869 + b670273 commit 6f13a09

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

src/Symfony/Component/Notifier/Bridge/AmazonSns/AmazonSnsOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function recipient(string $topic): self
5252
}
5353

5454
/**
55-
* @see PublishInput::$Subject
55+
* @see PublishInput::$subject
5656
*
5757
* @return $this
5858
*/
@@ -64,7 +64,7 @@ public function subject(string $subject): self
6464
}
6565

6666
/**
67-
* @see PublishInput::$MessageStructure
67+
* @see PublishInput::$messageStructure
6868
*
6969
* @return $this
7070
*/

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@ DSN example
1010
AMAZON_SNS_DSN=sns://ACCESS_ID:ACCESS_KEY@default?region=REGION
1111
```
1212

13+
Adding Options to a Chat Message
14+
--------------------------------
15+
16+
With an Amazon SNS Chat Message, you can use the `AmazonSnsOptions` class to add
17+
message options.
18+
19+
```php
20+
use Symfony\Component\Notifier\Message\ChatMessage;
21+
use Symfony\Component\Notifier\Bridge\AmazonSns\AmazonSnsOptions;
22+
23+
$chatMessage = new ChatMessage('Contribute To Symfony');
24+
25+
$options = (new AmazonSnsOptions('topic_arn'))
26+
->subject('subject')
27+
->messageStructure('json')
28+
// ...
29+
;
30+
31+
// Add the custom options to the chat message and send the message
32+
$chatMessage->options($options);
33+
34+
$chatter->send($chatMessage);
35+
```
36+
1337
Resources
1438
---------
1539

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,29 @@ where:
1616
- `FROM` is the sender
1717
- `TYPE_QUALITY` is the quality of your message: `N` for high, `L` for medium, `LL` for low (default: `L`)
1818

19+
Adding Options to a Message
20+
---------------------------
21+
22+
With a Mobyt Message, you can use the `MobytOptions` class to add
23+
[message options](https://gatewayapi.com/docs/apis/rest/).
24+
25+
```php
26+
use Symfony\Component\Notifier\Message\SmsMessage;
27+
use Symfony\Component\Notifier\Bridge\Mobyt\MobytOptions;
28+
29+
$sms = new SmsMessage('+1411111111', 'My message');
30+
31+
$options = (new MobytOptions())
32+
->messageType(MobytOptions::MESSAGE_TYPE_QUALITY_HIGH)
33+
// ...
34+
;
35+
36+
// Add the custom options to the sms message and send the message
37+
$sms->options($options);
38+
39+
$texter->send($sms);
40+
```
41+
1942
Resources
2043
---------
2144

0 commit comments

Comments
 (0)
0