$flowListener =
function DFlowSendMailActionEvent
$event) use (&
$flowEvent): void
{ $event =
$this->
onFlowSendMailActionEvent($event);
if ($event instanceof FlowSendMailActionEvent
) { $flowEvent =
$event;
} };
$this->
addEventListener($this->eventDispatcher, FlowSendMailActionEvent::
class,
$flowListener);
$mailEvent = null;
$mailListener =
function DMailBeforeSentEvent
$event) use (&
$mailEvent): void
{ $event =
$this->
onMailBeforeSentEvent($event);
if ($event instanceof MailBeforeSentEvent
) { $mailEvent =
$event;
} };
$this->
addEventListener($this->eventDispatcher, MailBeforeSentEvent::
class,
$mailListener);
$this->
changeTransactionStateToPaid($orderId);
$this->
resetEventDispatcher();