@@ -1428,21 +1428,26 @@ is sent::
1428
1428
// do something with the message
1429
1429
}
1430
1430
1431
- Execute this command to find out which listeners are registered for this event and
1432
- their priorities:
1431
+ Execute this command to find out which listeners are registered for this event
1432
+ and their priorities:
1433
1433
1434
1434
.. code-block :: terminal
1435
1435
1436
1436
$ php bin/console debug:event-dispatcher "Symfony\Component\Mailer\Event\MessageEvent"
1437
1437
1438
1438
SentMessageEvent
1439
- ~~~~~~~~~~~~
1439
+ ~~~~~~~~~~~~~~~~
1440
1440
1441
1441
**Event Class **: :class: `Symfony\\ Component\\ Mailer\\ Event\\ SentMessageEvent `
1442
1442
1443
- ``SentMessageEvent `` it allows you to act on the :class: `Symfony\\ Component\\\M ailer\\\S entMessage ` to access the original
1444
- message (getOriginalMessage()) and some debugging information (getDebug()) such as
1445
- the HTTP calls made by the HTTP transports, which is useful for debugging errors::
1443
+ .. versionadded :: 6.2
1444
+
1445
+ The ``SentMessageEvent `` event was introduced in Symfony 6.2.
1446
+
1447
+ ``SentMessageEvent `` allows you to act on the :class: `Symfony\\ Component\\\M ailer\\\S entMessage `
1448
+ class to access the original message (``getOriginalMessage() ``) and some debugging
1449
+ information (``getDebug() ``) such as the HTTP calls made by the HTTP transports,
1450
+ which is useful for debugging errors::
1446
1451
1447
1452
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1448
1453
use Symfony\Component\Mailer\Event\SentMessageEvent;
@@ -1458,42 +1463,42 @@ the HTTP calls made by the HTTP transports, which is useful for debugging errors
1458
1463
// do something with the message
1459
1464
}
1460
1465
1461
- Execute this command to find out which listeners are registered for this event and
1462
- their priorities:
1466
+ Execute this command to find out which listeners are registered for this event
1467
+ and their priorities:
1463
1468
1464
1469
.. code-block :: terminal
1465
1470
1466
1471
$ php bin/console debug:event-dispatcher "Symfony\Component\Mailer\Event\SentMessageEvent"
1467
1472
1468
1473
FailedMessageEvent
1469
- ~~~~~~~~~~~~
1474
+ ~~~~~~~~~~~~~~~~~~
1470
1475
1471
1476
**Event Class **: :class: `Symfony\\ Component\\ Mailer\\ Event\\ FailedMessageEvent `
1472
1477
1473
- ``FailedMessageEvent `` it allows acting on the the initial message in case of a failure::
1478
+ .. versionadded :: 6.2
1479
+
1480
+ The ``FailedMessageEvent `` event was introduced in Symfony 6.2.
1481
+
1482
+ ``FailedMessageEvent `` allows acting on the the initial message in case of a failure::
1474
1483
1475
1484
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1476
1485
use Symfony\Component\Mailer\Event\FailedMessageEvent;
1477
1486
1478
1487
public function onMessage(FailedMessageEvent $event): void
1479
1488
{
1480
- // e.g you can get more information on this error when sending an email.
1489
+ // e.g you can get more information on this error when sending an email
1481
1490
$event->getError();
1482
1491
1483
1492
// do something with the message
1484
1493
}
1485
1494
1486
- Execute this command to find out which listeners are registered for this event and
1487
- their priorities:
1495
+ Execute this command to find out which listeners are registered for this event
1496
+ and their priorities:
1488
1497
1489
1498
.. code-block :: terminal
1490
1499
1491
1500
$ php bin/console debug:event-dispatcher "Symfony\Component\Mailer\Event\FailedMessageEvent"
1492
1501
1493
- .. versionadded :: 6.2
1494
-
1495
- ``SentMessageEvent `` and ``FailedMessageEvent `` were introduced in Symfony 6.2.
1496
-
1497
1502
Development & Debugging
1498
1503
-----------------------
1499
1504
0 commit comments