Skip to content

Commit 8fd743c

Browse files
committed
minor #13624 Add Notifier SentMessage (jeremyFreeAgent)
This PR was merged into the master branch. Discussion ---------- Add Notifier SentMessage Commits ------- 416eb5b Add Notifier SentMessage
2 parents cec6219 + 416eb5b commit 8fd743c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

notifier/chatters.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ you to send messages to chat services like Slack or Telegram::
3232
// default transport (the first one configured)
3333
->transport('slack');
3434

35-
$chatter->send($message);
35+
$sentMessage = $chatter->send($message);
3636

3737
// ...
3838
}
3939
}
4040

41+
The ``$sentMessage`` (instance of
42+
:class:`Symfony\\Component\\Notifier\\Message\\SentMessage`) returned by
43+
``send()`` contains info about the sent message.
44+
4145
.. seealso::
4246

4347
Read :ref:`the main Notifier guide <notifier-chatter-dsn>` to see how
@@ -46,7 +50,7 @@ you to send messages to chat services like Slack or Telegram::
4650
Adding Interactions to a Slack Message
4751
--------------------------------------
4852

49-
With a Slack message, you can use the
53+
With a Slack message, you can use the
5054
:class:`Symfony\\Component\\Notifier\\Bridge\\Slack\\SlackOptions` to add
5155
some interactive options called `Block elements`_::
5256

notifier/texters.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ you to send SMS messages::
1414

1515
// src/Controller/SecurityController.php
1616
namespace App\Controller;
17-
17+
1818
use Symfony\Component\Notifier\Message\SmsMessage;
1919
use Symfony\Component\Notifier\TexterInterface;
2020
use Symfony\Component\Routing\Annotation\Route;
@@ -33,12 +33,16 @@ you to send SMS messages::
3333
'A new login was detected!'
3434
);
3535

36-
$texter->send($sms);
36+
$sentMessage = $texter->send($sms);
3737

3838
// ...
3939
}
4040
}
4141

42+
The ``$sentMessage`` (instance of
43+
:class:`Symfony\\Component\\Notifier\\Message\\SentMessage`) returned by
44+
``send()`` contains info about the sent message.
45+
4246
.. seealso::
4347

4448
Read :ref:`the main Notifier guide <notifier-texter-dsn>` to see how

0 commit comments

Comments
 (0)