Files
kupshop/bundles/KupShop/KupShopBundle/Email/UserDataEmail.php
2025-08-02 16:30:27 +02:00

53 lines
1.2 KiB
PHP

<?php
namespace KupShop\KupShopBundle\Email;
class UserDataEmail extends BaseEmail
{
protected static $name = 'GDPR Údaje o uživateli';
protected static $type = 'USER_DATA';
protected static $priority = 0;
protected $subject = 'Údaje o uživateli z e-shopu {WEB_NAZEV}';
protected $template = 'email/email_gdpr_user_data.tpl';
protected $email;
public function setEmail($email)
{
$this->email = $email;
}
public function testEmail(): array
{
$this->setEmail('test@email.cz');
return parent::testEmail();
}
public static function getPlaceholders()
{
$placeholders = [
'EMAIL' => [
'text' => 'E-mail uživatele',
],
];
return [self::$type => $placeholders] + (parent::getPlaceholders() ?? []);
}
public function replacePlaceholdersItem($placeholder)
{
if ($placeholder == 'EMAIL') {
return $this->email;
}
return parent::replacePlaceholdersItem($placeholder);
}
public function getAttachments($template): array
{
return $template['attachments'] ?? [];
}
}