From a11e156f56e767b08eef3c1992610e1050c205ec Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 30 Nov 2022 11:06:41 +0000 Subject: [PATCH] Use mail_to help to avoid handcrafting mailto links This also reworks the user suspended page to avoid having html in the translation strings. --- app/views/users/blocked.html.erb | 2 +- app/views/users/suspended.html.erb | 3 ++- config/locales/en.yml | 15 +++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/views/users/blocked.html.erb b/app/views/users/blocked.html.erb index 5753ebd9a..d2b2f6d3b 100644 --- a/app/views/users/blocked.html.erb +++ b/app/views/users/blocked.html.erb @@ -8,5 +8,5 @@

<%= t "users.new.no_auto_account_create" %>

-

<%= t "users.new.contact_support_html", :support => "mailto:#{Settings.support_email}" %>

+

<%= t "users.new.please_contact_support_html", :support_link => mail_to(Settings.support_email, t("users.new.support")) %>

diff --git a/app/views/users/suspended.html.erb b/app/views/users/suspended.html.erb index ff9c7d354..41dd0f018 100644 --- a/app/views/users/suspended.html.erb +++ b/app/views/users/suspended.html.erb @@ -4,4 +4,5 @@

<%= t ".heading" %>

<% end %> -<%= t ".body_html", :webmaster => link_to(t(".support"), "mailto:#{Settings.support_email}") %> +

<%= t ".automatically_suspended" %>

+

<%= t ".contact_support_html", :support_link => mail_to(Settings.support_email, t(".support")) %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index e05dfd8d0..0d52e59a7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2554,7 +2554,8 @@ en: new: title: "Sign Up" no_auto_account_create: "Unfortunately we are not currently able to create an account for you automatically." - contact_support_html: 'Please contact support to arrange for an account to be created - we will try and deal with the request as quickly as possible.' + please_contact_support_html: 'Please contact %{support_link} to arrange for an account to be created - we will try and deal with the request as quickly as possible.' + support: support about: header: Free and editable html: | @@ -2676,15 +2677,9 @@ en: title: Account Suspended heading: Account Suspended support: support - body_html: | -

- Sorry, your account has been automatically suspended due to - suspicious activity. -

-

- This decision will be reviewed by an administrator shortly, or - you may contact %{webmaster} if you wish to discuss this. -

+ automatically_suspended: Sorry, your account has been automatically suspended due to suspicious activity. + contact_support_html: This decision will be reviewed by an administrator shortly, or you may contact %{support_link} if you wish to discuss this. + support: support auth_failure: connection_failed: Connection to authentication provider failed invalid_credentials: Invalid authentication credentials -- 2.39.5