Skip to content

Commit 6adfa1d

Browse files
committed
minor #18557 [Notifier] Add options parameter to SmsMessage (Timherlaud)
This PR was merged into the 6.3 branch. Discussion ---------- [Notifier] Add options parameter to SmsMessage Follow up #17546 Add options to SmsMessage on notifier documentation Commits ------- a4a5cce Update notifier.rst
2 parents d1de154 + a4a5cce commit 6adfa1d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

notifier.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,19 @@ send SMS messages::
184184
#[Route('/login/success')]
185185
public function loginSuccess(TexterInterface $texter): Response
186186
{
187+
$options = (new ProviderOptions())
188+
->setPriority('high')
189+
;
190+
187191
$sms = new SmsMessage(
188192
// the phone number to send the SMS message to
189193
'+1411111111',
190194
// the message
191195
'A new login was detected!',
192196
// optionally, you can override default "from" defined in transports
193197
'+1422222222',
198+
// you can also add options object implementing MessageOptionsInterface
199+
$options
194200
);
195201

196202
$sentMessage = $texter->send($sms);
@@ -203,6 +209,10 @@ send SMS messages::
203209

204210
The 3rd argument of ``SmsMessage`` (``$from``) was introduced in Symfony 6.2.
205211

212+
.. versionadded:: 6.3
213+
214+
The 4th argument of ``SmsMessage`` (``$options``) was introduced in Symfony 6.3.
215+
206216
The ``send()`` method returns a variable of type
207217
:class:`Symfony\\Component\\Notifier\\Message\\SentMessage` which provides
208218
information such as the message ID and the original message contents.

0 commit comments

Comments
 (0)