From 8b0c60d2f92fc9f9a463c7412a582bb5e22ffceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 14 Apr 2026 17:01:46 +0200 Subject: [PATCH] Fix bugs --- .../Modules/Project/Http/Project/SMTP/Test/Create.php | 8 +++++--- .../Platform/Modules/Project/Http/Project/SMTP/Update.php | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Test/Create.php b/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Test/Create.php index a9a59cba85..fb93806983 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Test/Create.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Test/Create.php @@ -59,6 +59,7 @@ class Create extends Action ->inject('response') ->inject('project') ->inject('queueForMails') + ->inject('plan') ->callback($this->action(...)); } @@ -69,7 +70,8 @@ class Create extends Action array $emails, Response $response, Document $project, - Mail $queueForMails + Mail $queueForMails, + array $plan ): void { $smtp = $project->getAttribute('smtp', []); @@ -106,7 +108,7 @@ class Create extends Action $replyToEmail = !empty($replyTo) ? $replyTo : $senderEmail; $subject = 'Custom SMTP email sample'; - $template = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-smtp-test.tpl'); + $template = Template::fromFile(APP_CE_CONFIG_DIR . '/locale/templates/email-smtp-test.tpl'); $template ->setParam('{{from}}', "{$senderName} ({$senderEmail})") ->setParam('{{replyTo}}', "{$senderName} ({$replyToEmail})") @@ -130,7 +132,7 @@ class Create extends Action ->setSmtpSenderName($senderName) ->setRecipient($email) ->setName('') - ->setBodyTemplate(__DIR__ . '/../../config/locale/templates/email-base-styled.tpl') + ->setBodyTemplate(APP_CE_CONFIG_DIR . '/locale/templates/email-base-styled.tpl') ->setBody($template->render()) ->setVariables([]) ->setSubject($subject) diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Update.php index 027ced5664..43bedb87c2 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Update.php @@ -99,6 +99,8 @@ class Update extends Action $project = $authorization->skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('smtp', $smtp))); $response->dynamic($project, Response::MODEL_PROJECT); + + return; } // Validate SMTP settings