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\TemplateWithRenderer;
|
2019-06-17 02:29:19 +05:30
|
|
|
use yii\base\InvalidCallException;
|
2017-04-21 04:11:43 +05:30
|
|
|
|
|
|
|
class ForgotPasswordEmail extends TemplateWithRenderer {
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
private ?ForgotPasswordParams $params = null;
|
2017-04-21 04:11:43 +05:30
|
|
|
|
|
|
|
public function getSubject(): string {
|
|
|
|
return 'Ely.by Account forgot password';
|
|
|
|
}
|
|
|
|
|
2017-04-25 04:39:59 +05:30
|
|
|
public function getTemplateName(): string {
|
2017-04-21 04:11:43 +05:30
|
|
|
return 'forgotPassword';
|
|
|
|
}
|
|
|
|
|
2019-06-17 02:29:19 +05:30
|
|
|
public function setParams(ForgotPasswordParams $params): void {
|
|
|
|
$this->params = $params;
|
|
|
|
}
|
|
|
|
|
2017-04-21 04:11:43 +05:30
|
|
|
public function getParams(): array {
|
2019-06-17 02:29:19 +05:30
|
|
|
if ($this->params === null) {
|
|
|
|
throw new InvalidCallException('You need to set params first');
|
|
|
|
}
|
|
|
|
|
2017-04-21 04:11:43 +05:30
|
|
|
return [
|
2024-12-02 15:40:55 +05:30
|
|
|
'username' => $this->params->username,
|
|
|
|
'code' => $this->params->code,
|
|
|
|
'link' => $this->params->link,
|
2017-04-21 04:11:43 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|