We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a79bc7 commit 11596b0Copy full SHA for 11596b0
mailer.rst
@@ -1483,6 +1483,20 @@ the email is sent::
1483
// do something with the message
1484
}
1485
1486
+If you want to stop the Message from being sent, call ``reject()`` (it will
1487
+also stop the event propagation)::
1488
+
1489
+ use Symfony\Component\Mailer\Event\MessageEvent;
1490
1491
+ public function onMessage(MessageEvent $event): void
1492
+ {
1493
+ $event->reject();
1494
+ }
1495
1496
+.. versionadded:: 6.3
1497
1498
+ The ``reject()`` method was introduced in Symfony 6.3.
1499
1500
.. tip::
1501
1502
When using a ``MessageEvent`` listener to
0 commit comments