(fix): fall back to default template when base template is unreadable

This commit is contained in:
Chirag Aggarwal committed 2026-07-15 08:54:35 +05:30
1 parent 403377044d
commit 350927cce9
1 file changed
+4
@@ -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');