2017-04-21 01:41:43 +03:00
|
|
|
<?php
|
2019-06-07 02:16:13 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-04-24 19:22:24 +03:00
|
|
|
namespace common\emails\templates;
|
2017-04-21 01:41:43 +03:00
|
|
|
|
2017-04-24 19:22:24 +03:00
|
|
|
use common\emails\Template;
|
2019-06-16 23:59:19 +03:00
|
|
|
use yii\base\InvalidCallException;
|
2017-04-21 01:41:43 +03:00
|
|
|
|
2019-06-16 23:59:19 +03:00
|
|
|
class ChangeEmail extends Template {
|
2017-04-21 01:41:43 +03:00
|
|
|
|
2019-06-16 23:59:19 +03:00
|
|
|
/**
|
|
|
|
* @var string|null
|
|
|
|
*/
|
2017-04-21 01:41:43 +03:00
|
|
|
private $key;
|
|
|
|
|
2019-06-16 23:59:19 +03:00
|
|
|
public function setKey(string $key): void {
|
2017-04-21 01:41:43 +03:00
|
|
|
$this->key = $key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSubject(): string {
|
|
|
|
return 'Ely.by Account change E-mail confirmation';
|
|
|
|
}
|
|
|
|
|
2018-04-17 23:47:25 +03:00
|
|
|
public function getParams(): array {
|
2019-06-16 23:59:19 +03:00
|
|
|
if ($this->key === null) {
|
|
|
|
throw new InvalidCallException('You need to set key param first');
|
|
|
|
}
|
|
|
|
|
2018-04-17 23:47:25 +03:00
|
|
|
return [
|
|
|
|
'key' => $this->key,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2017-04-21 01:41:43 +03:00
|
|
|
protected function getView() {
|
|
|
|
return [
|
2017-04-24 19:31:38 +03:00
|
|
|
'html' => '@common/emails/views/current-email-confirmation-html',
|
|
|
|
'text' => '@common/emails/views/current-email-confirmation-text',
|
2017-04-21 01:41:43 +03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|