Skip to content

Commit 6a1901d

Browse files
authored
Replace misused EventListener with an EventSubscriber.
The existing code for the "Global from Address" makes use of an EventSubscriber but the namespace & name of the file is wrongly named as an EventListener which could create confusion.
1 parent 84a0f10 commit 6a1901d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mailer.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ Global from Address
258258
Instead of calling ``->from()`` *every* time you create a new email, you can
259259
create an event subscriber to set it automatically::
260260

261-
// src/EventListener/MailerFromListener.php
262-
namespace App\EventListener;
261+
// src/EventSubscriber/MailerFromSubscriber.php
262+
namespace App\EventSubscriber;
263263

264264
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
265265
use Symfony\Component\Mailer\Event\MessageEvent;
266266
use Symfony\Component\Mime\Email;
267267

268-
class MailerFromListener implements EventSubscriberInterface
268+
class MailerFromSubscriber implements EventSubscriberInterface
269269
{
270270
public function onMessageSend(MessageEvent $event)
271271
{

0 commit comments

Comments
 (0)