8000 [Notifier] Document Notifier options in README files 5.4 by alamirault · Pull Request #50379 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Notifier] Document Notifier options in README files 5.4 #50379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function recipient(string $topic): self
}

/**
* @see PublishInput::$Subject
* @see PublishInput::$subject
*
* @return $this
*/
Expand All @@ -64,7 +64,7 @@ public function subject(string $subject): self
}

/**
* @see PublishInput::$MessageStructure
* @see PublishInput::$messageStructure
*
* @return $this
*/
Expand Down
24 changes: 24 additions & 0 deletions src/Symfony/Component/Notifier/Bridge/AmazonSns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,30 @@ DSN example
AMAZON_SNS_DSN=sns://ACCESS_ID:ACCESS_KEY@default?region=REGION
```

Adding Options to a Chat Message
--------------------------------

With an Amazon SNS Chat Message, you can use the `AmazonSnsOptions` class to add
message options.

```php
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Bridge\AmazonSns\AmazonSnsOptions;

$chatMessage = new ChatMessage('Contribute To Symfony');

$options = (new AmazonSnsOptions('topic_arn'))
->subject('subject')
->messageStructure('json')
// ...
;

// Add the custom options to the chat message and send the message
$chatMessage->options($options);

$chatter->send($chatMessage);
```

Resources
---------

Expand Down
23 changes: 23 additions & 0 deletions src/Symfony/Component/Notifier/Bridge/Mobyt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ where:
- `FROM` is the sender
- `TYPE_QUALITY` is the quality of your message: `N` for high, `L` for medium, `LL` for low (default: `L`)

Adding Options to a Message
---------------------------

With a Mobyt Message, you can use the `MobytOptions` class to add
[message options](https://gatewayapi.com/docs/apis/rest/).

```php
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Mobyt\MobytOptions;

$sms = new SmsMessage('+1411111111', 'My message');

$options = (new MobytOptions())
->messageType(MobytOptions::MESSAGE_TYPE_QUALITY_HIGH)
// ...
;

// Add the custom options to the sms message and send the message
$sms->options($options);

$texter->send($sms);
```

Resources
---------

Expand Down
0