Compare commits

...
Author SHA1 Message Date
Hemachandar eb914324ac use console config 2025-11-12 20:18:41 +05:30
Hemachandar c2779def76 Customize email preview and heading between Console and projects 2025-10-28 19:39:42 +05:30
3 changed files with 23 additions and 3 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 -2
View File
@@ -4,8 +4,8 @@
"settings.direction": "ltr",
"emails.sender": "{{project}} Team",
"emails.verification.subject": "Account Verification for {{project}}",
"emails.verification.preview": "Verify your email to activate your {{project}} account.",
"emails.verification.heading": "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}},",
"emails.verification.body": "Follow this link to verify your email address to your {{b}}{{project}}{{/b}} account.",
"emails.verification.footer": "If you didnt ask to verify this address, you can ignore this message.",
+7 -1
View File
@@ -3635,10 +3635,16 @@ App::post('/v1/account/verifications/email')
$projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]');
$body = $locale->getText("emails.verification.body");
$preview = $locale->getText("emails.verification.preview");
$subject = $locale->getText("emails.verification.subject");
$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');