src/EventSubscriber/Order/SendOrderConfirmationMailSubsriber.php line 29
<?php/** This file is part of the Pellipop project.** (c) Mobizel** For the full copyright and license information, please view the LICENSE* file that was distributed with this source code.*/declare(strict_types=1);namespace App\EventSubscriber\Order;use App\Email\MailerInterface;use App\Entity\Order\Order;use Symfony\Component\EventDispatcher\EventSubscriberInterface;use Symfony\Component\Workflow\Event\Event;use Webmozart\Assert\Assert;class SendOrderConfirmationMailSubsriber implements EventSubscriberInterface{public function __construct(private MailerInterface $mailer,) {}public function onEnter(Event $event){/** @var Order $order */$order = $event->getSubject();Assert::isInstanceOf($order, Order::class);$this->mailer->sendOrderConfirmationEmail($order);}public static function getSubscribedEvents(){return ['workflow.order_production.entered.order_received' => 'onEnter',];}}