custom/plugins/MegasolBase/src/Subscriber/CustomerRegisterSubscriber.php line 22

Open in your IDE?
  1. <?php
  2. namespace Megasol\MegasolBase\Subscriber;
  3. use Shopware\Core\Checkout\Customer\CustomerEvents;
  4. use Shopware\Core\Framework\Event\DataMappingEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class CustomerRegisterSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents()
  9.     {
  10.         // TODO: Implement getSubscribedEvents() method.
  11.         return [
  12.             CustomerEvents::MAPPING_REGISTER_CUSTOMER => 'onCustomerRegister'
  13.         ];
  14.     }
  15.     public function onCustomerRegister(DataMappingEvent $event): void
  16.     {
  17.         dump('RegisterCustomer Event');
  18.         $output $event->getOutput();
  19.         // get form all data
  20.         $data $event->getInput();
  21.         dump($event);
  22.         dump($output);
  23.         dump($data);
  24.         // 1. create an email to send at info@megasol.ch with detail intel
  25.         // 2. create second email for customer, inform him
  26.         // redirect special site and inform user
  27.         die();
  28.     }
  29. }