From 9c4d329cebd105ba33f3fef01908ee62fc1421d5 Mon Sep 17 00:00:00 2001
From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com>
Date: Wed, 6 Dec 2023 23:00:05 +0100
Subject: [PATCH] Fix the order
---
app/config/locale/templates/email-inner-base.tpl | 4 ++--
app/controllers/api/account.php | 6 +-----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/app/config/locale/templates/email-inner-base.tpl b/app/config/locale/templates/email-inner-base.tpl
index eda6ede786..dce592ef92 100644
--- a/app/config/locale/templates/email-inner-base.tpl
+++ b/app/config/locale/templates/email-inner-base.tpl
@@ -4,12 +4,12 @@
{{body}}
-{{securityPhrase}}
-
{{redirect}}
{{code}}
+{{securityPhrase}}
+
{{footer}}
diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php
index d99b713e56..0903be0fcd 100644
--- a/app/controllers/api/account.php
+++ b/app/controllers/api/account.php
@@ -1123,7 +1123,7 @@ App::post('/v1/account/sessions/magic-url')
'Uplift', 'Velvet', 'Wanderlust', 'Zest'
);
- $securityPhraseString = $wordArray1[array_rand($wordArray1)] . $wordArray2[array_rand($wordArray2)];
+ $securityPhraseString = "
We have received a login attempt with the following phrase:
" . $wordArray1[array_rand($wordArray1)] . " " . $wordArray2[array_rand($wordArray2)] . "
";
}
$token = new Document([
@@ -1160,10 +1160,6 @@ App::post('/v1/account/sessions/magic-url')
$subject = $locale->getText("emails.magicSession.subject");
$customTemplate = $project->getAttribute('templates', [])['email.magicSession-' . $locale->default] ?? [];
- if ($securityPhrase) {
- $body = $body . "
We have received a login attempt with the following phrase: ";
- }
-
$message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-inner-base.tpl');
$message
->setParam('{{body}}', $body)