From d3f4b5fe9491fd3650e94a65b737ff136f031e11 Mon Sep 17 00:00:00 2001 From: IanM Date: Mon, 18 Sep 2023 14:01:40 +0100 Subject: [PATCH] use markdown in email footer translations --- framework/core/locale/core.yml | 12 +++++++----- .../core/views/email/html/information/base.blade.php | 2 +- .../views/email/html/notification/base.blade.php | 6 +++--- .../views/email/plain/information/base.blade.php | 2 +- .../views/email/plain/notification/base.blade.php | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/framework/core/locale/core.yml b/framework/core/locale/core.yml index 1ab71e06f5..dae82cbfa7 100644 --- a/framework/core/locale/core.yml +++ b/framework/core/locale/core.yml @@ -753,17 +753,19 @@ core: # These translations are used by the "informational" email template. informational: default_title: "Information" - footer: "This email was sent to {userEmail} as an informational service related to your account on {forumTitle}."# + footer: "This email was sent to {userEmail} as an informational service related to your account on [{forumTitle}]({forumUrl})." + footer_plain: "This email was sent to {userEmail} as an informational service related to your account on {forumTitle}." # These translations are used by the "notification" email template. notification: default_title: "Notification" footer: - main_text: "This email was sent to {email} because you are subscribed to \"{type}\" notifications on {forumTitle}." - unsubscribe_text: "If you'd like to stop receiving this type of notification, unsubscribe here." + main_text: "This email was sent to {email} because you are subscribed to \"{type}\" notifications on [{forumTitle}]({forumUrl})." + main_text_plain: "This email was sent to {email} because you are subscribed to \"{type}\" notifications on {forumTitle}." + unsubscribe_text: "If you'd like to stop receiving this type of notification, [unsubscribe here]({unsubscribeLink})." unsubscribe_text_plain: "If you'd like to stop receiving this type of notification, unsubscribe here: {unsubscribeLink}" - settings_text: "Manage your notification settings here." - settings_text_plain: "Manage your notification settings here." + settings_text: "Manage your notification settings [here]({settingsLink})." + settings_text_plain: "Manage your notification settings here: {settingsLink}" # These translations are used in emails sent when users register new accounts. activate_account: diff --git a/framework/core/views/email/html/information/base.blade.php b/framework/core/views/email/html/information/base.blade.php index a143b6b440..0ed9902c16 100644 --- a/framework/core/views/email/html/information/base.blade.php +++ b/framework/core/views/email/html/information/base.blade.php @@ -12,5 +12,5 @@ @endsection @section('footer') -

{!! $translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumTitle' => '' . $settings->get('forum_title') . '']) !!}

+

{!! $formatter->convert($translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumUrl' => $url->to('forum')->base(), 'forumTitle' => $settings->get('forum_title')])) !!}

@endsection diff --git a/framework/core/views/email/html/notification/base.blade.php b/framework/core/views/email/html/notification/base.blade.php index 72c28acfed..0d7bc3d0f0 100644 --- a/framework/core/views/email/html/notification/base.blade.php +++ b/framework/core/views/email/html/notification/base.blade.php @@ -12,7 +12,7 @@ @endsection @section('footer') -

{!! $translator->trans('core.email.notification.footer.main_text', ['email' => $user->email, 'type' => $type, 'forumTitle' => '' . $settings->get('forum_title') . '']) !!}

-

{!! $translator->trans('core.email.notification.footer.unsubscribe_text', ['unsubscribeLink' => $unsubscribeLink]) !!}

-

{!! $translator->trans('core.email.notification.footer.settings_text', ['settingsLink' => $settingsLink]) !!}

+

{!! $formatter->convert($translator->trans('core.email.notification.footer.main_text', ['email' => $user->email, 'type' => $type, 'forumUrl' => $url->to('forum')->base(), 'forumTitle' => $settings->get('forum_title')])) !!}

+

{!! $formatter->convert($translator->trans('core.email.notification.footer.unsubscribe_text', ['unsubscribeLink' => $unsubscribeLink])) !!}

+

{!! $formatter->convert($translator->trans('core.email.notification.footer.settings_text', ['settingsLink' => $settingsLink])) !!}

@endsection diff --git a/framework/core/views/email/plain/information/base.blade.php b/framework/core/views/email/plain/information/base.blade.php index dc703f7e54..bec65b6e8f 100644 --- a/framework/core/views/email/plain/information/base.blade.php +++ b/framework/core/views/email/plain/information/base.blade.php @@ -9,5 +9,5 @@ @endsection @section('footer') -{!! $translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumTitle' => $forumTitle]) !!} +{!! $translator->trans('core.email.informational.footer_plain', ['userEmail' => $userEmail, 'forumTitle' => $forumTitle]) !!} @endsection diff --git a/framework/core/views/email/plain/notification/base.blade.php b/framework/core/views/email/plain/notification/base.blade.php index 9f86bfab3e..b048784cf1 100644 --- a/framework/core/views/email/plain/notification/base.blade.php +++ b/framework/core/views/email/plain/notification/base.blade.php @@ -9,7 +9,7 @@ @endsection @section('footer') -{!! $translator->trans('core.email.notification.footer.main_text', ['email' => $user->email, 'type' => $type, 'forumTitle' => $forumTitle]) !!} +{!! $translator->trans('core.email.notification.footer.main_text_plain', ['email' => $user->email, 'type' => $type, 'forumTitle' => $forumTitle]) !!} {!! $translator->trans('core.email.notification.footer.unsubscribe_text_plain', ['unsubscribeLink' => $unsubscribeLink]) !!}