first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace KupShop\GTMBundle\ServerSideGTMEvent;
use KupShop\GTMBundle\Utils\DataLoaders\PurchaseState;
use KupShop\UserBundle\Event\UserNewsletterEvent;
use Symfony\Contracts\EventDispatcher\Event;
class UserSubscribeEvent extends AbstractServerSideGTMEvent
{
protected function getPayload(Event $event): array
{
if (!($event instanceof UserNewsletterEvent)) {
return [];
}
return $this->getCommonData($event) +
[
'events' => [
'name' => $this->getEventName(),
'params' => [
'email' => $event->getEmail(),
'shaEmail' => PurchaseState::shaEmail($event->getEmail()),
],
],
];
}
public function getEventName(): string
{
return 'success_newsletter_subscribe';
}
}