From 350927cce946cf4dce87285aa8dfc3a14b11e4c6 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 15 Jul 2026 08:54:35 +0530 Subject: [PATCH] (fix): fall back to default template when base template is unreadable --- .../Platform/Modules/Teams/Http/Memberships/Create.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Create.php b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Create.php index c5eeb8a7e6..8010e9c4e1 100644 --- a/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Create.php +++ b/src/Appwrite/Platform/Modules/Teams/Http/Memberships/Create.php @@ -336,6 +336,10 @@ class Create extends Action throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Invalid template path'); } $bodyTemplate = APP_CE_CONFIG_DIR . '/locale/templates/' . $smtpBaseTemplate . '.tpl'; + if (! \is_readable($bodyTemplate)) { + $smtpBaseTemplate = 'email-base'; + $bodyTemplate = APP_CE_CONFIG_DIR . '/locale/templates/email-base.tpl'; + } $body = $locale->getText('emails.invitation.body'); $preview = $locale->getText('emails.invitation.preview');