Include amount in refund email

This commit is contained in:
Maikel Linke
2026-02-23 12:21:45 +11:00
parent 96c2b75a0a
commit f2eec5685e
4 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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