0

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);
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.