From f8ab95b3e15636fa25cb8f346d516d2b5b43ec89 Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Tue, 16 Sep 2025 11:54:01 +0530 Subject: [PATCH] tests & lint --- app/config/console.php | 12 +----------- app/controllers/api/account.php | 6 +++--- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/config/console.php b/app/config/console.php index 164db597e9..9690cb8f28 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -71,16 +71,7 @@ $console = [ 'body' => 'Enter the following code to confirm your two-step verification in {{b}}{{project}}{{/b}}. This code will expire in 15 minutes.', 'thanks' => 'Thanks,', "signature" => "{{project}} team", - ], - 'email.otpSession-en' => [ - 'subject' => 'OTP for {{project}} account login', - 'preview' => 'Use OTP {{otp}} to sign in to {{project}}. Expires in 15 minutes.', - 'heading' => 'Login with OTP to use Appwrite Cloud', - 'hello' => 'Hello {{user}},', - 'body' => 'Enter the following verification code when prompted to securely sign in to your {{b}}{{project}}{{/b}} account. This code will expire in 15 minutes.', - 'thanks' => 'Thanks,', - "signature" => "{{project}} team", - ], + ] ], 'customEmails' => true, ]; @@ -88,7 +79,6 @@ $console = [ foreach ($localeCodes as $localeCode) { $console['templates']['email.verification-'.$localeCode['code']] = $console['templates']['email.verification-en']; $console['templates']['email.mfaChallenge-'.$localeCode['code']] = $console['templates']['email.mfaChallenge-en']; - $console['templates']['email.otpSession-'.$localeCode['code']] = $console['templates']['email.otpSession-en']; } return $console; diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 355ad2ec5d..37ebceba17 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -2364,7 +2364,7 @@ App::post('/v1/account/tokens/email') ->setSmtpReplyTo($replyTo) ->setSmtpSenderEmail($senderEmail) ->setSmtpSenderName($senderName); - } else if ($customEmails) { + } elseif ($customEmails && !empty($customTemplate)) { $subject = $customTemplate['subject']; $preview = $customTemplate['preview']; $heading = $customTemplate['heading']; @@ -3671,7 +3671,7 @@ App::post('/v1/account/verification') ->setSmtpReplyTo($replyTo) ->setSmtpSenderEmail($senderEmail) ->setSmtpSenderName($senderName); - } else if ($customEmails) { + } elseif ($customEmails && !empty($customTemplate)) { $subject = $customTemplate['subject']; $preview = $customTemplate['preview']; $heading = $customTemplate['heading']; @@ -4782,7 +4782,7 @@ App::post('/v1/account/mfa/challenge') ->setSmtpReplyTo($replyTo) ->setSmtpSenderEmail($senderEmail) ->setSmtpSenderName($senderName); - } else if ($customEmails) { + } elseif ($customEmails && !empty($customTemplate)) { $subject = $customTemplate['subject']; $preview = $customTemplate['preview']; $heading = $customTemplate['heading'];