File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed
Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function getRecipientId(): ?string
3333 /**
3434 * @return $this
3535 */
36- public function class (int $ class ): static
36+ public function class (string $ class ): static
3737 {
3838 $ this ->options ['class ' ] = $ class ;
3939
Original file line number Diff line number Diff line change @@ -16,6 +16,31 @@ where:
1616
1717See your account info at https://gatewayapi.com
1818
19+ Adding Options to a Message
20+ ---------------------------
21+
22+ With a GatewayApi Message, you can use the ` GatewayApiOptions ` 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\GatewayApi\GatewayApiOptions;
28+
29+ $sms = new SmsMessage('+1411111111', 'My message');
30+
31+ $options = (new GatewayApiOptions())
32+ ->class('standard')
33+ ->callbackUrl('https://my-callback-url')
34+ ->userRef('user_ref')
35+ // ...
36+ ;
37+
38+ // Add the custom options to the sms message and send the message
39+ $sms->options($options);
40+
41+ $texter->send($sms);
42+ ```
43+
1944Resources
2045---------
2146
Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ class GatewayApiOptionsTest extends TestCase
1919 public function testGatewayApiOptions ()
2020 {
2121 $ gatewayApiOptions = (new GatewayApiOptions ())
22- ->class (123 )
22+ ->class (' test_class ' )
2323 ->callbackUrl ('test_callback_url ' )
2424 ->userRef ('test_user_ref ' );
2525
2626 self ::assertSame ([
27- 'class ' => 123 ,
27+ 'class ' => ' test_class ' ,
2828 'callback_url ' => 'test_callback_url ' ,
2929 'userref ' => 'test_user_ref ' ,
3030 ], $ gatewayApiOptions ->toArray ());
You can’t perform that action at this time.
0 commit comments