mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
use console config
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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}},",
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user