<?php
namespace Megasol\MegasolBase\Subscriber;
use Shopware\Core\Checkout\Customer\CustomerEvents;
use Shopware\Core\Framework\Event\DataMappingEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class CustomerRegisterSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
// TODO: Implement getSubscribedEvents() method.
return [
CustomerEvents::MAPPING_REGISTER_CUSTOMER => 'onCustomerRegister'
];
}
public function onCustomerRegister(DataMappingEvent $event): void
{
dump('RegisterCustomer Event');
$output = $event->getOutput();
// get form all data
$data = $event->getInput();
dump($event);
dump($output);
dump($data);
// 1. create an email to send at info@megasol.ch with detail intel
// 2. create second email for customer, inform him
// redirect special site and inform user
die();
}
}