@@ -812,9 +812,10 @@ The :class:`Symfony\\Component\\Mailer\\SentMessage` object returned by the
812
812
provides access to the original message (``getOriginalMessage() ``) and to some
813
813
debug information (``getDebug() ``) such as the HTTP calls done by the HTTP
814
814
transports, which is useful to debug errors.
815
- Access to :class: `Symfony\\ Component\\ Mailer\\ SentMessage ` can also be obtained by listening
816
- to the :ref: `SentMessageEvent <mailer-sent-message-event >`, and to ``getDebug() `` by listening
817
- to the :ref: `FailedMessageEvent <mailer-failed-message-event >`."
815
+
816
+ You can also access :class: `Symfony\\ Component\\ Mailer\\ SentMessage ` by listening
817
+ to the :ref: `SentMessageEvent <mailer-sent-message-event >` and retrieve ``getDebug() ``
818
+ by listening to the :ref: `FailedMessageEvent <mailer-failed-message-event >`.
818
819
819
820
.. note ::
820
821
@@ -1730,18 +1731,17 @@ SentMessageEvent
1730
1731
1731
1732
``SentMessageEvent `` allows you to act on the :class: `Symfony\\ Component\\\M ailer\\\S entMessage `
1732
1733
class to access the original message (``getOriginalMessage() ``) and some
1733
- :ref: `debugging information <mailer-debugging-emails >` (``getDebug() ``) such as the HTTP calls
1734
- made by the HTTP transports, which is useful for debugging errors::
1734
+ :ref: `debugging information <mailer-debugging-emails >` (``getDebug() ``) such as
1735
+ the HTTP calls made by the HTTP transports, which is useful for debugging errors::
1735
1736
1736
1737
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1737
1738
use Symfony\Component\Mailer\Event\SentMessageEvent;
1738
1739
1739
1740
public function onMessage(SentMessageEvent $event): void
1740
1741
{
1741
- // e.g you can get mail id
1742
- $event->getMessage();
1742
+ $message $event->getMessage();
1743
1743
1744
- // do something with the message
1744
+ // do something with the message (e.g. get its id)
1745
1745
}
1746
1746
1747
1747
Execute this command to find out which listeners are registered for this event
@@ -1762,9 +1762,9 @@ FailedMessageEvent
1762
1762
1763
1763
The ``FailedMessageEvent `` event was introduced in Symfony 6.2.
1764
1764
1765
- ``FailedMessageEvent `` allows acting on the initial message in case of a failure and some
1766
- :ref: `debugging information <mailer-debugging-emails >` (``getDebug() ``) such as the HTTP calls made
1767
- by the HTTP transports, which is useful for debugging errors::
1765
+ ``FailedMessageEvent `` allows acting on the initial message in case of a failure
1766
+ and some :ref: `debugging information <mailer-debugging-emails >` (``getDebug() ``)
1767
+ such as the HTTP calls made by the HTTP transports, which is useful for debugging errors::
1768
1768
1769
1769
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1770
1770
use Symfony\Component\Mailer\Event\FailedMessageEvent;
0 commit comments