Skip to content

Commit f396dda

Browse files
alamiraultnicolas-grekas
authored andcommitted
[Notifier] Document Notifier options in README files
1 parent 58af3e1 commit f396dda

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,40 @@ where:
1414
- `TOKEN` is your MessageBird token
1515
- `FROM` is your sender
1616

17+
Adding Options to a Message
18+
---------------------------
19+
20+
With a MessageBird Message, you can use the `MessageBirdOptions` class to add
21+
[message options](https://developers.messagebird.com/api/sms-messaging/#send-outbound-sms).
22+
23+
```php
24+
use Symfony\Component\Notifier\Message\SmsMessage;
25+
use Symfony\Component\Notifier\Bridge\MessageBird\MessageBirdOptions;
26+
27+
$sms = new SmsMessage('+1411111111', 'My message');
28+
29+
$options = (new MessageBirdOptions())
30+
->type('test_type')
31+
->scheduledDatetime('test_scheduled_datetime')
32+
->createdDatetime('test_created_datetime')
33+
->dataCoding('test_data_coding')
34+
->gateway(999)
35+
->groupIds(['test_group_ids'])
36+
->mClass(888)
37+
->reference('test_reference')
38+
->reportUrl('test_report_url')
39+
->shortenUrls(true)
40+
->typeDetails('test_type_details')
41+
->validity(777)
42+
// ...
43+
;
44+
45+
// Add the custom options to the sms message and send the message
46+
$sms->options($options);
47+
48+
$texter->send($sms);
49+
```
50+
1751
Resources
1852
---------
1953

0 commit comments

Comments
 (0)