accounts/common/emails/templates/ChangeEmail.php

42 lines
883 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace common\emails\templates;
use common\emails\Template;
use yii\base\InvalidCallException;
class ChangeEmail extends Template {
/**
* @var string|null
*/
private $key;
public function setKey(string $key): void {
$this->key = $key;
}
public function getSubject(): string {
return 'Ely.by Account change E-mail confirmation';
}
2018-04-18 02:17:25 +05:30
public function getParams(): array {
if ($this->key === null) {
throw new InvalidCallException('You need to set key param first');
}
2018-04-18 02:17:25 +05:30
return [
'key' => $this->key,
];
}
protected function getView() {
return [
'html' => '@common/emails/views/current-email-confirmation-html',
'text' => '@common/emails/views/current-email-confirmation-text',
];
}
}