use console config

This commit is contained in:
Hemachandar
2025-11-12 20:18:41 +05:30
parent c2779def76
commit eb914324ac
3 changed files with 22 additions and 4 deletions
+14
View File
@@ -9,6 +9,8 @@ use Appwrite\Network\Platform;
use Utopia\Database\Helpers\ID;
use Utopia\System\System;
$localeCodes = include __DIR__ . '/locale/codes.php';
$console = [
'$id' => ID::custom('console'),
'$sequence' => ID::custom('console'),
@@ -50,6 +52,18 @@ $console = [
'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', '')
],
'smtpBaseTemplate' => APP_BRANDED_EMAIL_BASE_TEMPLATE,
'customEmailContent' => [
'verification' => [
'en' => [
'preview' => 'Verify your email to activate your {{project}} account.',
'heading' => 'Verify your email to start using {{project}}',
]
]
]
];
foreach ($localeCodes as $localeCode) {
$console['customEmailContent']['verification'][$localeCode['code']] = $console['customEmailContent']['verification']['en'];
}
return $console;
-2
View File
@@ -4,8 +4,6 @@
"settings.direction": "ltr",
"emails.sender": "{{project}} Team",
"emails.verification.subject": "Account Verification for {{project}}",
"emails.verification.preview-appwrite": "Verify your email to activate your {{project}} account.",
"emails.verification.heading-appwrite": "Verify your email to start using {{project}}",
"emails.verification.preview": "Verify your email for {{project}} account.",
"emails.verification.heading": "Verify your email for {{project}}",
"emails.verification.hello": "Hello {{user}},",
+8 -2
View File
@@ -3636,8 +3636,14 @@ App::post('/v1/account/verifications/email')
$projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]');
$body = $locale->getText("emails.verification.body");
$subject = $locale->getText("emails.verification.subject");
$preview = $projectName === 'Appwrite' ? $locale->getText("emails.verification.preview-appwrite") : $locale->getText("emails.verification.preview");
$heading = $projectName === 'Appwrite' ? $locale->getText("emails.verification.heading-appwrite") : $locale->getText("emails.verification.heading");
$preview = $locale->getText("emails.verification.preview");
$heading = $locale->getText("emails.verification.heading");
$customEmailContent = $project->getAttribute('customEmailContent', [])['verification'][$locale->default] ?? [];
if (!empty($customEmailContent)) {
$preview = $customEmailContent['preview'] ?? $preview;
$heading = $customEmailContent['heading'] ?? $heading;
}
$customTemplate = $project->getAttribute('templates', [])['email.verification-' . $locale->default] ?? [];
$smtpBaseTemplate = $project->getAttribute('smtpBaseTemplate', 'email-base');