[Mailer] Don't dispatch MessageEvent twice
This commit is contained in:
parent
829566cdea
commit
fc4be4822a
@ -49,11 +49,6 @@ final class Mailer implements MailerInterface
|
|||||||
$clonedEnvelope = null !== $envelope ? clone $envelope : Envelope::create($clonedMessage);
|
$clonedEnvelope = null !== $envelope ? clone $envelope : Envelope::create($clonedMessage);
|
||||||
$event = new MessageEvent($clonedMessage, $clonedEnvelope, (string) $this->transport, true);
|
$event = new MessageEvent($clonedMessage, $clonedEnvelope, (string) $this->transport, true);
|
||||||
$this->dispatcher->dispatch($event);
|
$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));
|
$this->bus->dispatch(new SendEmailMessage($message, $envelope));
|
||||||
|
Reference in New Issue
Block a user