first commit
This commit is contained in:
52
bundles/KupShop/KupShopBundle/Email/UserDataEmail.php
Normal file
52
bundles/KupShop/KupShopBundle/Email/UserDataEmail.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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'] ?? [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user