Skip to content

Commit 13aff44

Browse files
committed
Document MessageEvent::reject()
1 parent 7a79bc7 commit 13aff44

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

mailer.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,20 @@ the email is sent::
14831483
// do something with the message
14841484
}
14851485

1486+
.. versionadded:: 6.3
1487+
1488+
The ``reject()`` method was introduced in Symfony 6.3.
1489+
1490+
If you want to stop the Message from being sent, call ``reject()`` (it will
1491+
also stop the event propagation)::
1492+
1493+
use Symfony\Component\Mailer\Event\MessageEvent;
1494+
1495+
public function onMessage(MessageEvent $event): void
1496+
{
1497+
$event->reject();
1498+
}
1499+
14861500
.. tip::
14871501

14881502
When using a ``MessageEvent`` listener to

0 commit comments

Comments
 (0)