<?php

declare(strict_types=1);

namespace KupShop\UserBundle\Event;

use Symfony\Contracts\EventDispatcher\Event;

class UserNewsletterEvent extends Event
{
    public const SUBSCRIBED = 'kupshop.user.newsletter.subscribed';

    public const UNSUBSCRIBED = 'kupshop.user.newsletter.unsubscribed';

    // nepotřebuji instanci usera, k celemu procesu potřebuji jen email, ve View kde přistupuji k newsletteru nemam instanci usera
    public function __construct(private readonly string $email)
    {
    }

    public function getEmail(): string
    {
        return $this->email ?? '';
    }
}
