Skip to content

Commit

Permalink
use markdown in email footer translations
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Sep 18, 2023
1 parent b0d688e commit d3f4b5f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
12 changes: 7 additions & 5 deletions framework/core/locale/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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, <a href=\"{unsubscribeLink}\">unsubscribe here</a>."
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 <a href=\"{settingsLink}\">here</a>."
settings_text_plain: "Manage your notification settings <a href=\"{settingsLink}\">here</a>."
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:
Expand Down
2 changes: 1 addition & 1 deletion framework/core/views/email/html/information/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
@endsection

@section('footer')
<p>{!! $translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumTitle' => '<a href="' . $url->to('forum')->base() . '">' . $settings->get('forum_title') . '</a>']) !!}</p>
<p>{!! $formatter->convert($translator->trans('core.email.informational.footer', ['userEmail' => $userEmail, 'forumUrl' => $url->to('forum')->base(), 'forumTitle' => $settings->get('forum_title')])) !!}</p>
@endsection
6 changes: 3 additions & 3 deletions framework/core/views/email/html/notification/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@endsection

@section('footer')
<p>{!! $translator->trans('core.email.notification.footer.main_text', ['email' => $user->email, 'type' => $type, 'forumTitle' => '<a href="' . $url->to('forum')->base() . '">' . $settings->get('forum_title') . '</a>']) !!}</p>
<p>{!! $translator->trans('core.email.notification.footer.unsubscribe_text', ['unsubscribeLink' => $unsubscribeLink]) !!}</p>
<p>{!! $translator->trans('core.email.notification.footer.settings_text', ['settingsLink' => $settingsLink]) !!}</p>
<p>{!! $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')])) !!}</p>
<p>{!! $formatter->convert($translator->trans('core.email.notification.footer.unsubscribe_text', ['unsubscribeLink' => $unsubscribeLink])) !!}</p>
<p>{!! $formatter->convert($translator->trans('core.email.notification.footer.settings_text', ['settingsLink' => $settingsLink])) !!}</p>
@endsection
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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]) !!}

Expand Down

0 comments on commit d3f4b5f

Please sign in to comment.