I have created a custom event subscriber for Commerce, but when the event is triggered, somehow the Order number is increased by +1 and I get suddenly confirmation emails for 2 orders.
I'm not doing anything special when the event happens, just sending a test email.
static function getSubscribedEvents() {
$events['commerce_order.place.post_transition'] = ['orderCompleteHandler', -200];
return $events;
}
And this is the event action:
$this->mailManager->mail('commerce', 'receipt', $to, $langcode, $params, $reply, $send);