From f2eec5685e25327b96c3fa5402db0c4cac870a54 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 23 Feb 2026 12:21:45 +1100 Subject: [PATCH] Include amount in refund email --- app/mailers/payment_mailer.rb | 1 + app/views/payment_mailer/refund_available.html.haml | 2 +- config/locales/en.yml | 2 +- spec/mailers/payment_mailer_spec.rb | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/mailers/payment_mailer.rb b/app/mailers/payment_mailer.rb index 957f0cdf02..6805f31bc8 100644 --- a/app/mailers/payment_mailer.rb +++ b/app/mailers/payment_mailer.rb @@ -24,6 +24,7 @@ class PaymentMailer < ApplicationMailer def refund_available(payment, taler_order_status_url) @order = payment.order @shop = @order.distributor.name + @amount = payment.display_amount @taler_order_status_url = taler_order_status_url I18n.with_locale valid_locale(@order.user) do diff --git a/app/views/payment_mailer/refund_available.html.haml b/app/views/payment_mailer/refund_available.html.haml index 94680ef385..a5d27a8c63 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(".message", shop: @shop) +%p= t(".message", shop: @shop, amount: @amount) %p= link_to @taler_order_status_url, @taler_order_status_url diff --git a/config/locales/en.yml b/config/locales/en.yml index 2917d93374..bf2406c867 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -468,7 +468,7 @@ en: refund_available: subject: "Refund from %{shop}" message: | - Your payment to %{shop} is being refunded. + Your payment of %{amount} to %{shop} is being refunded. Accept your refund following the link below. producer_mailer: order_cycle: diff --git a/spec/mailers/payment_mailer_spec.rb b/spec/mailers/payment_mailer_spec.rb index 59ece0186b..b5fd38d2c5 100644 --- a/spec/mailers/payment_mailer_spec.rb +++ b/spec/mailers/payment_mailer_spec.rb @@ -49,8 +49,8 @@ RSpec.describe PaymentMailer do mail = PaymentMailer.refund_available(payment, link) expect(mail.subject).to eq "Refund from Carrot Castle" - expect(mail.body).to match "Your payment to Carrot Castle is being refunded." - expect(mail.body).to match link + expect(mail.body).to include "Your payment of $45.75 to Carrot Castle is being refunded." + expect(mail.body).to include link end end end