From c66b9611b6f98d4dee167bba6e5970c73b7a3cd7 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 6 Feb 2026 09:53:12 +1100 Subject: [PATCH] Move PaymentMailer translations out of Spree namespace The mailer is not in the Spree namespace and we don't need to keep the clutter. --- app/mailers/payment_mailer.rb | 6 +++--- .../authorization_required.html.haml | 2 +- .../authorize_payment.html.haml | 2 +- .../payment_mailer/refund_available.html.haml | 2 +- config/locales/en.yml | 20 +++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/mailers/payment_mailer.rb b/app/mailers/payment_mailer.rb index b73756d9ec..9dd8172dff 100644 --- a/app/mailers/payment_mailer.rb +++ b/app/mailers/payment_mailer.rb @@ -6,7 +6,7 @@ class PaymentMailer < ApplicationMailer def authorize_payment(payment) @payment = payment @order = @payment.order - subject = I18n.t('spree.payment_mailer.authorize_payment.subject', + subject = I18n.t("payment_mailer.authorize_payment.subject", distributor: @order.distributor.name) I18n.with_locale valid_locale(@order.user) do mail(to: @order.email, @@ -18,7 +18,7 @@ class PaymentMailer < ApplicationMailer def authorization_required(payment) @order = payment.order shop_owner = @order.distributor.owner - subject = I18n.t('spree.payment_mailer.authorization_required.subject', + subject = I18n.t("payment_mailer.authorization_required.subject", order: @order) I18n.with_locale valid_locale(shop_owner) do mail(to: shop_owner.email, @@ -31,7 +31,7 @@ class PaymentMailer < ApplicationMailer @order = payment.order @taler_order_status_url = taler_order_status_url - subject = I18n.t("spree.payment_mailer.refund_available.subject", + subject = I18n.t("payment_mailer.refund_available.subject", order: @order) I18n.with_locale valid_locale(@order.user) do mail(to: @order.email, diff --git a/app/views/payment_mailer/authorization_required.html.haml b/app/views/payment_mailer/authorization_required.html.haml index 391ccbc04a..0bf1be0f16 100644 --- a/app/views/payment_mailer/authorization_required.html.haml +++ b/app/views/payment_mailer/authorization_required.html.haml @@ -1,2 +1,2 @@ -= t('spree.payment_mailer.authorization_required.message', order_number: @order.number) += t(".message", order_number: @order.number) = link_to spree.edit_admin_order_url(@order), spree.edit_admin_order_url(@order) diff --git a/app/views/payment_mailer/authorize_payment.html.haml b/app/views/payment_mailer/authorize_payment.html.haml index ea25e0e7b4..ce7535c57b 100644 --- a/app/views/payment_mailer/authorize_payment.html.haml +++ b/app/views/payment_mailer/authorize_payment.html.haml @@ -1,2 +1,2 @@ -= t('spree.payment_mailer.authorize_payment.instructions', distributor: @payment.order.distributor.name, amount: @payment.display_amount) += t(".instructions", distributor: @payment.order.distributor.name, amount: @payment.display_amount) = link_to main_app.authorize_payment_url(@payment), main_app.authorize_payment_url(@payment) diff --git a/app/views/payment_mailer/refund_available.html.haml b/app/views/payment_mailer/refund_available.html.haml index a980981f63..64cb380f13 100644 --- a/app/views/payment_mailer/refund_available.html.haml +++ b/app/views/payment_mailer/refund_available.html.haml @@ -1,2 +1,2 @@ -%p= t("spree.payment_mailer.refund_available.message", order_number: @order.number) +%p= t(".message", order_number: @order.number) %p= link_to @taler_order_status_url, @taler_order_status_url diff --git a/config/locales/en.yml b/config/locales/en.yml index 5a0659d29c..63caaca96a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -458,6 +458,16 @@ en: join_community: "Join the community" invite_manager: subject: "%{enterprise} has invited you to be a manager" + payment_mailer: + authorize_payment: + subject: "Please authorize your payment to %{distributor} on OFN" + instructions: "Your payment of %{amount} to %{distributor} requires additional authentication. Please visit the following URL to authorize your payment:" + authorization_required: + subject: "A payment requires authorization from the customer" + message: "A payment for order %{order_number} requires additional authorization from the customer. The customer has been notified via email and the payment will appear as pending until it is authorized." + refund_available: + subject: "Refund available" + message: "Your payment for order %{order_number} is being refunded. Claim your refund following the link below." producer_mailer: order_cycle: subject: "Order cycle report for %{producer}" @@ -4923,16 +4933,6 @@ en: subject: "Reset password instructions" confirmation_instructions: subject: "Please confirm your OFN account" - payment_mailer: - authorize_payment: - subject: "Please authorize your payment to %{distributor} on OFN" - instructions: "Your payment of %{amount} to %{distributor} requires additional authentication. Please visit the following URL to authorize your payment:" - authorization_required: - subject: "A payment requires authorization from the customer" - message: "A payment for order %{order_number} requires additional authorization from the customer. The customer has been notified via email and the payment will appear as pending until it is authorized." - refund_available: - subject: "Refund available" - message: "Your payment for order %{order_number} is being refunded. Claim your refund following the link below." shipment_mailer: shipped_email: dear_customer: "Dear Customer,"