From c2779def76f01a225165e840dc018d70d92b9eed Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Tue, 28 Oct 2025 19:39:42 +0530 Subject: [PATCH] Customize email preview and heading between Console and projects --- app/config/locale/translations/en.json | 6 ++++-- app/controllers/api/account.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/config/locale/translations/en.json b/app/config/locale/translations/en.json index cfac62d5ef..473ced86c0 100644 --- a/app/config/locale/translations/en.json +++ b/app/config/locale/translations/en.json @@ -4,8 +4,10 @@ "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-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}},", "emails.verification.body": "Follow this link to verify your email address to your {{b}}{{project}}{{/b}} account.", "emails.verification.footer": "If you didn’t ask to verify this address, you can ignore this message.", diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 5563fc6a59..b98fe6c1c8 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -3635,9 +3635,9 @@ 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"); - $heading = $locale->getText("emails.verification.heading"); + $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"); $customTemplate = $project->getAttribute('templates', [])['email.verification-' . $locale->default] ?? []; $smtpBaseTemplate = $project->getAttribute('smtpBaseTemplate', 'email-base');