mirror of
https://github.com/elyby/accounts.git
synced 2024-12-27 23:50:19 +05:30
52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace common\emails\templates;
|
|
|
|
use common\emails\Template;
|
|
use yii\base\InvalidCallException;
|
|
|
|
class ConfirmNewEmail extends Template {
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
private $username;
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
private $key;
|
|
|
|
public function setUsername(string $username): void {
|
|
$this->username = $username;
|
|
}
|
|
|
|
public function setKey(string $key): void {
|
|
$this->key = $key;
|
|
}
|
|
|
|
public function getSubject(): string {
|
|
return 'Ely.by Account new E-mail confirmation';
|
|
}
|
|
|
|
public function getParams(): array {
|
|
if ($this->username === null || $this->key === null) {
|
|
throw new InvalidCallException('You need to set username and key params first');
|
|
}
|
|
|
|
return [
|
|
'username' => $this->username,
|
|
'key' => $this->key,
|
|
];
|
|
}
|
|
|
|
protected function getView() {
|
|
return [
|
|
'html' => '@common/emails/views/new-email-confirmation-html',
|
|
'text' => '@common/emails/views/new-email-confirmation-text',
|
|
];
|
|
}
|
|
|
|
}
|