mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Компонент для email'ов перемещён в common
This commit is contained in:
35
common/emails/templates/ChangeEmailConfirmCurrentEmail.php
Normal file
35
common/emails/templates/ChangeEmailConfirmCurrentEmail.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace common\emails\templates;
|
||||
|
||||
use common\emails\Template;
|
||||
|
||||
class ChangeEmailConfirmCurrentEmail extends Template {
|
||||
|
||||
private $key;
|
||||
|
||||
public function __construct($to, string $key) {
|
||||
parent::__construct($to);
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
public function getSubject(): string {
|
||||
return 'Ely.by Account change E-mail confirmation';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|array
|
||||
*/
|
||||
protected function getView() {
|
||||
return [
|
||||
'html' => '@api/mails/current-email-confirmation-html',
|
||||
'text' => '@api/mails/current-email-confirmation-text',
|
||||
];
|
||||
}
|
||||
|
||||
public function getParams(): array {
|
||||
return [
|
||||
'key' => $this->key,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
39
common/emails/templates/ChangeEmailConfirmNewEmail.php
Normal file
39
common/emails/templates/ChangeEmailConfirmNewEmail.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace common\emails\templates;
|
||||
|
||||
use common\emails\Template;
|
||||
|
||||
class ChangeEmailConfirmNewEmail extends Template {
|
||||
|
||||
private $username;
|
||||
|
||||
private $key;
|
||||
|
||||
public function __construct($to, string $username, string $key) {
|
||||
parent::__construct($to);
|
||||
$this->username = $username;
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
public function getSubject(): string {
|
||||
return 'Ely.by Account new E-mail confirmation';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|array
|
||||
*/
|
||||
protected function getView() {
|
||||
return [
|
||||
'html' => '@api/mails/new-email-confirmation-html',
|
||||
'text' => '@api/mails/new-email-confirmation-text',
|
||||
];
|
||||
}
|
||||
|
||||
public function getParams(): array {
|
||||
return [
|
||||
'key' => $this->key,
|
||||
'username' => $this->username,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
34
common/emails/templates/ForgotPasswordEmail.php
Normal file
34
common/emails/templates/ForgotPasswordEmail.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace common\emails\templates;
|
||||
|
||||
use common\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(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
30
common/emails/templates/ForgotPasswordParams.php
Normal file
30
common/emails/templates/ForgotPasswordParams.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace common\emails\templates;
|
||||
|
||||
class ForgotPasswordParams {
|
||||
|
||||
private $username;
|
||||
|
||||
private $code;
|
||||
|
||||
private $link;
|
||||
|
||||
public function __construct(string $username, string $code, string $link) {
|
||||
$this->username = $username;
|
||||
$this->code = $code;
|
||||
$this->link = $code;
|
||||
}
|
||||
|
||||
public function getUsername(): string {
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function getCode(): string {
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
public function getLink(): string {
|
||||
return $this->link;
|
||||
}
|
||||
|
||||
}
|
||||
34
common/emails/templates/RegistrationEmail.php
Normal file
34
common/emails/templates/RegistrationEmail.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace common\emails\templates;
|
||||
|
||||
use common\emails\TemplateWithRenderer;
|
||||
|
||||
class RegistrationEmail extends TemplateWithRenderer {
|
||||
|
||||
private $params;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function __construct($to, string $locale, RegistrationEmailParams $params) {
|
||||
TemplateWithRenderer::__construct($to, $locale);
|
||||
$this->params = $params;
|
||||
}
|
||||
|
||||
public function getSubject(): string {
|
||||
return 'Ely.by Account registration';
|
||||
}
|
||||
|
||||
protected function getTemplateName(): string {
|
||||
return 'register';
|
||||
}
|
||||
|
||||
public function getParams(): array {
|
||||
return [
|
||||
'username' => $this->params->getUsername(),
|
||||
'code' => $this->params->getCode(),
|
||||
'link' => $this->params->getLink(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
30
common/emails/templates/RegistrationEmailParams.php
Normal file
30
common/emails/templates/RegistrationEmailParams.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace common\emails\templates;
|
||||
|
||||
class RegistrationEmailParams {
|
||||
|
||||
private $username;
|
||||
|
||||
private $code;
|
||||
|
||||
private $link;
|
||||
|
||||
public function __construct(string $username, string $code, string $link) {
|
||||
$this->username = $username;
|
||||
$this->code = $code;
|
||||
$this->link = $code;
|
||||
}
|
||||
|
||||
public function getUsername(): string {
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function getCode(): string {
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
public function getLink(): string {
|
||||
return $this->link;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user