8000 [Mailer] Replace misused EventListener with an EventSubscriber. by Irvyne · Pull Request #12250 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Mailer] Replace misused EventListener with an EventSubscriber. #12250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ Global from Address
Instead of calling ``->from()`` *every* time you create a new email, you can
create an event subscriber to set it automatically::

// src/EventListener/MailerFromListener.php
namespace App\EventListener;
// src/EventSubscriber/MailerFromSubscriber.php
namespace App\EventSubscriber;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Mailer\Event\MessageEvent;
use Symfony\Component\Mime\Email;

class MailerFromListener implements EventSubscriberInterface
class MailerFromSubscriber implements EventSubscriberInterface
{
public function onMessageSend(MessageEvent $event)
{
Expand Down
0