10000 [Notifier] Document Notifier options in README files · symfony/symfony@e770344 · GitHub
[go: up one dir, main page]

Skip to content

Commit e770344

Browse files
alamiraultnicolas-grekas
authored andcommitted
[Notifier] Document Notifier options in README files
1 parent 746c06b commit e770344

File tree

5 files changed

+138
-0
lines changed

5 files changed

+138
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,34 @@ where:
1919
- `APPLICATION_ID` is your application ID
2020
- `PRIORITY` is your priority (optional)
2121

22+
Adding Options to a Message
23+
---------------------------
24+
25+
With a Bandwidth Message, you can use the `BandwidthOptions` class to add
26+
[message options](https://dev.bandwidth.com/apis/messaging/#tag/Messages/operation/createMessage).
27+
28+
```php
29+
use Symfony\Component\Notifier\Message\SmsMessage;
30+
use Symfony\Component\Notifier\Bridge\Bandwidth\BandwidthOptions;
31+
32+
$sms = new SmsMessage('+1411111111', 'My message');
33+
34+
$options = (new BandwidthOptions())
35+
->media(['foo'])
36+
->tag('tag')
37+
->accountId('account_id')
38+
->applicationId('application_id')
39+
->expiration('test_expiration')
40+
->priority('default')
41+
// ...
42+
;
43+
44+
// Add the custom options to the sms message and send the message
45+
$sms->options($options);
46+
47+
$texter->send($sms);
48+
```
49+
2250
Resources
2351
---------
2452

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,34 @@ where:
1919
- `LIST_ID` is your recipient list ID (optional)
2020
- `FROM_EMAIL` is your from email where replies must be emailed (optional)
2121

22+
Adding Options to a Message
23+
---------------------------
24+
25+
With a ClickSend Message, you can use the `ClickSendOptions` class to add
26+
[message options](https://developers.clicksend.com/docs/rest/v3/#send-sms/).
27+
28+
```php
29+
use Symfony\Component\Notifier\Message\SmsMessage;
30+
use Symfony\Component\Notifier\Bridge\ClickSend\ClickSendOptions;
31+
32+
$sms = new SmsMessage('+1411111111', 'My message');
33+
34+
$options = (new ClickSendOptions())
35+
->country('country')
36+
->customString('custom_string')
37+
->fromEmail('from_email')
38+
->listId('list_id')
39+
->schedule(999)
40+
->source('source')
41+
// ...
42+
;
43+
44+
// Add the custom options to the sms message and send the message
45+
$sms->options($options);
46+
47+
$texter->send($sms);
48+
```
49+
2250
Resources
2351
---------
2452

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,35 @@ where:
1616
- `AUTH_TOKEN` is your Plivo Auth Token
1717
- `FROM` is your sender
1818

19+
Adding Options to a Message
20+
---------------------------
21+
22+
With a Plivo Message, you can use the `PlivoOptions` class to add
23+
[message options](https://www.plivo.com/docs/sms/api/message#send-a-message).
24+
25+
```php
26+
use Symfony\Component\Notifier\Message\SmsMessage;
27+
use Symfony\Component\Notifier\Bridge\Plivo\PlivoOptions;
28+
29+
$sms = new SmsMessage('+1411111111', 'My message');
30+
31+
$options = (new PlivoOptions())
32+
->log(true)
33+
->method('POST')
34+
->url('url')
35+
->mediaUrls('media_urls')
36+
->powerpackUuid('uuid')
37+
->trackable(true)
38+
->type('sms')
39+
// ...
40+
;
41+
42+
// Add the custom options to the sms message and send the message
43+
$sms->options($options);
44+
45+
$texter->send($sms);
46+
```
47+
1948
Resources
2049
---------
2150

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@ where:
1515
- `API_TOKEN` is your Ring Central OAuth 2 token
1616
- `FROM` is your sender
1717

18+
Adding Options to a Message
19+
---------------------------
20+
21+
With a Ring Central Message, you can use the `RingCentralOptions` class to add
22+
[message options](https://developers.ringcentral.com/api-reference/SMS/createSMSMessage).
23+
24+
```php
25+
use Symfony\Component\Notifier\Message\SmsMessage;
26+
use Symfony\Component\Notifier\Bridge\RingCentral\RingCentralOptions;
27+
28+
$sms = new SmsMessage('+1411111111', 'My message');
29+
30+
$options = (new RingCentralOptions())
31+
->country(
32+
'test_country_id',
33+
'country_iso_code',
34+
'country_name',
35+
'country_uri',
36+
'country_calling_code'
37+
)
38+
// ...
39+
;
40+
41+
// Add the custom options to the sms message and send the message
42+
$sms->options($options);
43+
44+
$texter->send($sms);
45+
```
46+
1847
Resources
1948
---------
2049

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ where:
1515
- `API_KEY` is your Smsmode API key
1616
- `FROM` is your sender ID
1717

18+
Adding Options to a Message
19+
---------------------------
20+
21+
With a Smsmode Message, you can use the `SmsmodeOptions` class to add
22+
[message options](https://dev.smsmode.com/sms/v1/message).
23+
24+
```php
25+
use Symfony\Component\Notifier\Message\SmsMessage;
26+
use Symfony\Component\Notifier\Bridge\Smsmode\SmsmodeOptions;
27+
28+
$sms = new SmsMessage('+1411111111', 'My message');
29+
30+
$options = (new SmsmodeOptions())
31+
->refClient('ref_client')
32+
->sentDate('sent_date')
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+
1842
Resources
1943
---------
2044

0 commit comments

Comments
 (0)
0