File tree Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ To send a notification, autowire the
376
376
);
377
377
378
378
// Send the notification to the recipient
379
- $notifier->send($notification, $recipient);
379
+ $sentMessage = $ notifier->send($notification, $recipient);
380
380
381
381
// ...
382
382
}
@@ -387,6 +387,14 @@ channels. The channels specify which channel (or transport) should be used
387
387
to send the notification. For instance, ``['email', 'sms'] `` will send
388
388
both an email and sms notification to the user.
389
389
390
+ The ``send() `` method used to send the notification returns a variable of type
391
+ :class: `Symfony\\ Component\\ Notifier\\ Message\\ SentMessage ` which provides
392
+ information such as the message ID and the original message contents.
393
+
394
+ .. versionadded :: 5.2
395
+
396
+ The ``SentMessage `` class was introduced in Symfony 5.2.
397
+
390
398
The default notification also has a ``content() `` and ``emoji() `` method to
391
399
set the notification content and icon.
392
400
Original file line number Diff line number Diff line change @@ -38,9 +38,13 @@ you to send messages to chat services like Slack or Telegram::
38
38
}
39
39
}
40
40
41
- The ``$sentMessage `` (instance of
42
- :class: `Symfony\\ Component\\ Notifier\\ Message\\ SentMessage `) returned by
43
- ``send() `` contains info about the sent message.
41
+ The ``send() `` method returns a variable of type
42
+ :class: `Symfony\\ Component\\ Notifier\\ Message\\ SentMessage ` which provides
43
+ information such as the message ID and the original message contents.
44
+
45
+ .. versionadded :: 5.2
46
+
47
+ The ``SentMessage `` class was introduced in Symfony 5.2.
44
48
45
49
.. seealso ::
46
50
Original file line number Diff line number Diff line change @@ -39,9 +39,13 @@ you to send SMS messages::
39
39
}
40
40
}
41
41
42
- The ``$sentMessage `` (instance of
43
- :class: `Symfony\\ Component\\ Notifier\\ Message\\ SentMessage `) returned by
44
- ``send() `` contains info about the sent message.
42
+ The ``send() `` method returns a variable of type
43
+ :class: `Symfony\\ Component\\ Notifier\\ Message\\ SentMessage ` which provides
44
+ information such as the message ID and the original message contents.
45
+
46
+ .. versionadded :: 5.2
47
+
48
+ The ``SentMessage `` class was introduced in Symfony 5.2.
45
49
46
50
.. seealso ::
47
51
You can’t perform that action at this time.
0 commit comments