From df63cc08d8153410978561fbfea71fbacf78e7e3 Mon Sep 17 00:00:00 2001 From: drummer83 Date: Thu, 18 Jan 2024 01:33:37 +0100 Subject: [PATCH] Add new partial to user_mailers and re-organize used translation keys Remaining translation keys for emails will be re-organized in a separate commit --- .../confirmation_instructions.html.haml | 11 ++++++---- .../reset_password_instructions.html.haml | 10 +++++---- .../user_mailer/signup_confirmation.html.haml | 12 +++++------ config/locales/en.yml | 21 +++++++++++++------ 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/app/views/spree/user_mailer/confirmation_instructions.html.haml b/app/views/spree/user_mailer/confirmation_instructions.html.haml index 20d2424a4a..c2b3af71dc 100644 --- a/app/views/spree/user_mailer/confirmation_instructions.html.haml +++ b/app/views/spree/user_mailer/confirmation_instructions.html.haml @@ -1,7 +1,10 @@ -%h3 - = t :email_signup_greeting -%p.lead - = t :email_signup_welcome, sitename: @instance +- greeting_key = "mailers_shared.general_greeting" +- intro_key = ".welcome" + += render partial: 'shared/mailers/greeting_and_intro', + locals: { greeting: t(greeting_key), + intro: t(intro_key, sitename: @instance) } + %p= t :email_confirmation_activate_account %p.callout diff --git a/app/views/spree/user_mailer/reset_password_instructions.html.haml b/app/views/spree/user_mailer/reset_password_instructions.html.haml index 69a2f26f06..03f1f99861 100644 --- a/app/views/spree/user_mailer/reset_password_instructions.html.haml +++ b/app/views/spree/user_mailer/reset_password_instructions.html.haml @@ -1,7 +1,9 @@ -%h3 - = t('.dear_customer') -%p - = t('.request_sent_text') +- greeting_key = "mailers_shared.general_greeting" +- intro_key = ".request_sent_text" + += render partial: 'shared/mailers/greeting_and_intro', + locals: { greeting: t(greeting_key), + intro: t(intro_key) } %p.callout = t('.link_text') diff --git a/app/views/spree/user_mailer/signup_confirmation.html.haml b/app/views/spree/user_mailer/signup_confirmation.html.haml index 10cd5a64b7..899c89d549 100644 --- a/app/views/spree/user_mailer/signup_confirmation.html.haml +++ b/app/views/spree/user_mailer/signup_confirmation.html.haml @@ -1,10 +1,10 @@ -%h3 - = t :email_signup_greeting -%p.lead - = t :email_signup_welcome, sitename: Spree::Config[:site_name] +- greeting_key = "mailers_shared.general_greeting" +- intro_key = ".welcome" + += render partial: 'shared/mailers/greeting_and_intro', + locals: { greeting: t(greeting_key), + intro: t(intro_key, sitename: Spree::Config[:site_name]) } -/ Heading Panel -%p   %p = t :email_signup_confirmed_email %p diff --git a/config/locales/en.yml b/config/locales/en.yml index 1d69208b03..3961b1b887 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -364,6 +364,11 @@ en: mailer: open_food_network: "Open Food Network" powered_html: "This service is powered by the %{open_food_network}." + +# E-Mails +# + mailers_shared: + general_greeting: "Hello!" enterprise_mailer: confirmation_instructions: subject: "Please confirm the email address for %{enterprise}" @@ -2457,8 +2462,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using email_shipping_collection_instructions: "Collection instructions:" email_special_instructions: "Your notes:" - email_signup_greeting: Hello! - email_signup_welcome: "Welcome to %{sitename}!" email_signup_confirmed_email: "Thanks for confirming your email." email_signup_shop_html: "You can now log in at %{link}." email_signup_text: "Thanks for joining the network. @@ -3923,6 +3926,16 @@ See the %{link} to find out more about %{sitename}'s features and to start using error: Webhook endpoint failed to delete spree: + user_mailer: + confirmation_instructions: + welcome: "Welcome to %{sitename}!" + signup_confirmation: + welcome: "Welcome to %{sitename}!" + reset_password_instructions: + request_sent_text: | + A request to reset your password has been made. + If you did not make this request, simply ignore this email. + order_updated: "Order Updated" add_country: "Add country" add_state: "Add state" @@ -4687,10 +4700,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using invoice_attached_text: Please find attached an invoice for your recent order from user_mailer: reset_password_instructions: - dear_customer: "Dear customer," - request_sent_text: | - A request to reset your password has been made. - If you did not make this request, simply ignore this email. link_text: > If you did make this request just click the link below: issue_text: |