From 858b4fdca08fac320d5b4f7e72a95799368cb65d Mon Sep 17 00:00:00 2001 From: saparatayev Date: Sat, 5 Feb 2022 14:03:32 +0500 Subject: [PATCH] mail templates --- plugins/rainlab/user/components/Account.php | 4 ++-- plugins/tps/birzha/Plugin.php | 13 +++++++++-- .../tps/birzha/views/mail/en/email_verify.htm | 8 +++++++ .../tps/birzha/views/mail/layout-default.htm | 22 +++++++++++++++++++ .../tps/birzha/views/mail/layout-system.htm | 19 ++++++++++++++++ .../tps/birzha/views/mail/ru/email_verify.htm | 8 +++++++ .../tps/birzha/views/mail/tm/email_verify.htm | 8 +++++++ 7 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 plugins/tps/birzha/views/mail/en/email_verify.htm create mode 100644 plugins/tps/birzha/views/mail/layout-default.htm create mode 100644 plugins/tps/birzha/views/mail/layout-system.htm create mode 100644 plugins/tps/birzha/views/mail/ru/email_verify.htm create mode 100644 plugins/tps/birzha/views/mail/tm/email_verify.htm diff --git a/plugins/rainlab/user/components/Account.php b/plugins/rainlab/user/components/Account.php index 90674f1f6..27b4bb5e1 100644 --- a/plugins/rainlab/user/components/Account.php +++ b/plugins/rainlab/user/components/Account.php @@ -467,14 +467,14 @@ class Account extends ComponentBase ]; try { - \Mail::send('rainlab.user::mail.email_verification', $vars, function($message) { + \Mail::send('tps.birzha::mail.' . app()->getLocale() . '.email_verify', $vars, function($message) { $message->to($this->user()->email, 'Birzha User'); $message->subject('Подтверждение Email'); }); } catch(Throwable $th) { \Log::info($th); - Flash::error('Cannot verify. Invalid email address'); + Flash::error('tps.birzha::mail.' . app()->getLocale() . '.email_verify'); return \Redirect::to('profile'); } diff --git a/plugins/tps/birzha/Plugin.php b/plugins/tps/birzha/Plugin.php index 7191f44d9..ae14bbbd1 100644 --- a/plugins/tps/birzha/Plugin.php +++ b/plugins/tps/birzha/Plugin.php @@ -217,8 +217,8 @@ class Plugin extends PluginBase public function registerMailLayouts() { return [ -// 'default' => 'system::mail.layout-default', -// 'system' => 'system::mail.layout-system', + 'birzha_default' => 'tps.birzha::mail.layout-default', + // 'system' => 'tps.birzha::mail.layout-system', ]; } @@ -231,6 +231,15 @@ class Plugin extends PluginBase 'tps.birzha::mail.message', 'tps.birzha::mail.request', + // email verification + 'tps.birzha::mail.ru.email_verify', + 'tps.birzha::mail.en.email_verify', + 'tps.birzha::mail.tm.email_verify', + + // product reviewed + // 'tps.birzha::mail.ru.product_reviewed', + // 'tps.birzha::mail.en.product_reviewed', + // 'tps.birzha::mail.tm.product_reviewed', ]; } diff --git a/plugins/tps/birzha/views/mail/en/email_verify.htm b/plugins/tps/birzha/views/mail/en/email_verify.htm new file mode 100644 index 000000000..5f311ecf7 --- /dev/null +++ b/plugins/tps/birzha/views/mail/en/email_verify.htm @@ -0,0 +1,8 @@ +layout="birzha_default" +== + +

+ Hello. You successfully registered on the website of the State Stock + Exchange of Turkmenistan. In order to verify your email address and completely activate + your account, go through the link. +

\ No newline at end of file diff --git a/plugins/tps/birzha/views/mail/layout-default.htm b/plugins/tps/birzha/views/mail/layout-default.htm new file mode 100644 index 000000000..3b0d617ac --- /dev/null +++ b/plugins/tps/birzha/views/mail/layout-default.htm @@ -0,0 +1,22 @@ +name = "Default layout birzha" +== + + + + + + + + Document + + + +
header - default layout - birzha
+
{{ content|raw }}
+ + + \ No newline at end of file diff --git a/plugins/tps/birzha/views/mail/layout-system.htm b/plugins/tps/birzha/views/mail/layout-system.htm new file mode 100644 index 000000000..50cfa7a7b --- /dev/null +++ b/plugins/tps/birzha/views/mail/layout-system.htm @@ -0,0 +1,19 @@ + + + + + + + Document + + + +
header - system layout - birzha
+
{{ content|raw }}
+ + + \ No newline at end of file diff --git a/plugins/tps/birzha/views/mail/ru/email_verify.htm b/plugins/tps/birzha/views/mail/ru/email_verify.htm new file mode 100644 index 000000000..baa975ea4 --- /dev/null +++ b/plugins/tps/birzha/views/mail/ru/email_verify.htm @@ -0,0 +1,8 @@ +layout="birzha_default" +== + +

+ Здравствуйте. Вы успешно зарегистрировались на сайте Государственной + товарно-сырьевой биржи Туркменистана. Чтобы подтвердить адрес электронной почты + и полностью активировать учетную запись, перейдите по ссылке. +

\ No newline at end of file diff --git a/plugins/tps/birzha/views/mail/tm/email_verify.htm b/plugins/tps/birzha/views/mail/tm/email_verify.htm new file mode 100644 index 000000000..efc7adf54 --- /dev/null +++ b/plugins/tps/birzha/views/mail/tm/email_verify.htm @@ -0,0 +1,8 @@ +layout="birzha_default" +== + +

+ Salam. Siz Türkmenistanyň Döwlet + haryt-çig mal biržasynyň web-sahypasynda üstünlikli hasaba alyndyňyz. + Email salgyňyzy tassyklamak üçin, şu düwmäni basyň. +

\ No newline at end of file