Все части, отвечающие за отправку E-mail вынесены в отдельный компонент

This commit is contained in:
ErickSkrauch
2017-04-21 01:41:43 +03:00
parent 0e2aff91d0
commit c0780736ca
17 changed files with 427 additions and 126 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace api\emails\templates;
use api\emails\TemplateWithRenderer;
class ForgotPasswordEmail extends TemplateWithRenderer {
private $params;
/**
* @inheritdoc
*/
public function __construct($to, string $locale, ForgotPasswordParams $params) {
TemplateWithRenderer::__construct($to, $locale);
$this->params = $params;
}
public function getSubject(): string {
return 'Ely.by Account forgot password';
}
protected function getTemplateName(): string {
return 'forgotPassword';
}
public function getParams(): array {
return [
'username' => $this->params->getUsername(),
'code' => $this->params->getCode(),
'link' => $this->params->getLink(),
];
}
}