8000 minor #12250 [Mailer] Replace misused EventListener with an EventSubs… · symfony/symfony-docs@502806a · GitHub
[go: up one dir, main page]

Skip to content

Commit 502806a

Browse files
committed
minor #12250 [Mailer] Replace misused EventListener with an EventSubscriber. (Irvyne)
This PR was merged into the 4.3 branch. Discussion ---------- [Mailer] Replace misused EventListener with an EventSubscriber. In the new mailer component, 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. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 6a1901d Replace misused EventListener with an EventSubscriber.
2 parents 8438849 + 6a1901d commit 502806a

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)
0