2017-04-21 04:11:43 +05:30
|
|
|
<?php
|
2019-06-07 04:46:13 +05:30
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-04-24 21:52:24 +05:30
|
|
|
namespace common\emails\templates;
|
2017-04-21 04:11:43 +05:30
|
|
|
|
2017-04-24 21:52:24 +05:30
|
|
|
use common\emails\Template;
|
2019-06-17 02:29:19 +05:30
|
|
|
use yii\base\InvalidCallException;
|
2017-04-21 04:11:43 +05:30
|
|
|
|
2019-06-17 02:29:19 +05:30
|
|
|
class ConfirmNewEmail extends Template {
|
2017-04-21 04:11:43 +05:30
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
private ?string $username = null;
|
2017-04-21 04:11:43 +05:30
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
private ?string $key = null;
|
2017-04-21 04:11:43 +05:30
|
|
|
|
2019-06-17 02:29:19 +05:30
|
|
|
public function setUsername(string $username): void {
|
2017-04-21 04:11:43 +05:30
|
|
|
$this->username = $username;
|
2019-06-17 02:29:19 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
public function setKey(string $key): void {
|
2017-04-21 04:11:43 +05:30
|
|
|
$this->key = $key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSubject(): string {
|
|
|
|
return 'Ely.by Account new E-mail confirmation';
|
|
|
|
}
|
|
|
|
|
2018-04-18 02:17:25 +05:30
|
|
|
public function getParams(): array {
|
2019-06-17 02:29:19 +05:30
|
|
|
if ($this->username === null || $this->key === null) {
|
|
|
|
throw new InvalidCallException('You need to set username and key params first');
|
|
|
|
}
|
|
|
|
|
2018-04-18 02:17:25 +05:30
|
|
|
return [
|
|
|
|
'username' => $this->username,
|
2019-06-17 02:29:19 +05:30
|
|
|
'key' => $this->key,
|
2018-04-18 02:17:25 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
protected function getView(): array {
|
2017-04-21 04:11:43 +05:30
|
|
|
return [
|
2017-04-24 22:01:38 +05:30
|
|
|
'html' => '@common/emails/views/new-email-confirmation-html',
|
|
|
|
'text' => '@common/emails/views/new-email-confirmation-text',
|
2017-04-21 04:11:43 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|