minor #36531 [Mailer] Don't dispatch MessageEvent twice (chalasr)
This PR was merged into the 5.1-dev branch. Discussion ---------- [Mailer] Don't dispatch MessageEvent twice | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Introduced in829566cdea
Commits -------fc4be4822a
[Mailer] Don't dispatch MessageEvent twice
This commit is contained in:
commit
f2f82d1e14
@ -49,11 +49,6 @@ final class Mailer implements MailerInterface
|
||||
$clonedEnvelope = null !== $envelope ? clone $envelope : Envelope::create($clonedMessage);
|
||||
$event = new MessageEvent($clonedMessage, $clonedEnvelope, (string) $this->transport, true);
|
||||
$this->dispatcher->dispatch($event);
|
||||
|
||||
$message = clone $message;
|
||||
$envelope = null !== $envelope ? clone $envelope : Envelope::create($message);
|
||||
$event = new MessageEvent($message, $envelope, (string) $this->transport, true);
|
||||
$this->dispatcher->dispatch($event);
|
||||
}
|
||||
|
||||
$this->bus->dispatch(new SendEmailMessage($message, $envelope));
|
||||
|
Reference in New Issue
Block a user