setEmail('test@email.cz'); return parent::testEmail(); } public static function getPlaceholders() { $placeholders = [ 'EMAIL_UZIVATELE' => [ 'text' => 'E-mail uživatele', ], 'OVEROVACI_ADRESA' => [ 'text' => 'Ověřovací adresa', ], ]; return [self::$type => $placeholders] + (parent::getPlaceholders() ?? []); } public function replacePlaceholdersItem($placeholder) { if ($this->email) { switch ($placeholder) { case 'OVEROVACI_ADRESA': $today = new \DateTime(); $today = $today->format('d.m.Y'); $code = md5($this->email.'-'.$today); return path('kupshop_content_newsletter_subscribe', ['code' => $code, 'email' => $this->email], 0); case 'EMAIL_UZIVATELE': return $this->email; break; } } return parent::replacePlaceholdersItem($placeholder); } public function setEmail($email) { $this->email = $email; } }