From aff5cd8d44b52fefa937d2573702df346489c166 Mon Sep 17 00:00:00 2001 From: drummer83 Date: Sat, 15 Feb 2025 13:31:35 +0100 Subject: [PATCH 1/3] Add 'reply to' email address to payment emails --- app/mailers/payment_mailer.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/mailers/payment_mailer.rb b/app/mailers/payment_mailer.rb index 97db37e053..0bd1ec6532 100644 --- a/app/mailers/payment_mailer.rb +++ b/app/mailers/payment_mailer.rb @@ -17,12 +17,14 @@ class PaymentMailer < ApplicationMailer def authorization_required(payment) @payment = payment - shop_owner = @payment.order.distributor.owner + @order = @payment.order + shop_owner = @order.distributor.owner subject = I18n.t('spree.payment_mailer.authorization_required.subject', - order: @payment.order) + order: @order) I18n.with_locale valid_locale(shop_owner) do mail(to: shop_owner.email, - subject:) + subject:, + reply_to: @order.email) end end end From 71fa0f09c62f2fb511739eaf461426d4730e0c73 Mon Sep 17 00:00:00 2001 From: drummer83 Date: Sat, 15 Feb 2025 13:32:56 +0100 Subject: [PATCH 2/3] Add 'reply to' email address to order emails for shops --- app/mailers/spree/order_mailer.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/mailers/spree/order_mailer.rb b/app/mailers/spree/order_mailer.rb index e4d886d3e9..b396e79283 100644 --- a/app/mailers/spree/order_mailer.rb +++ b/app/mailers/spree/order_mailer.rb @@ -23,7 +23,8 @@ module Spree I18n.with_locale valid_locale(@order.distributor.owner) do subject = I18n.t('spree.order_mailer.cancel_email_for_shop.subject') mail(to: @order.distributor.contact.email, - subject:) + subject:, + reply_to: @order.email) end end @@ -43,7 +44,8 @@ module Spree I18n.with_locale valid_locale(@order.user) do subject = mail_subject(t('spree.order_mailer.confirm_email.subject'), resend) mail(to: @order.distributor.contact.email, - subject:) + subject:, + reply_to: @order.email) end end From dc749092b4c0f31bc3f074238fef81b84cf1c65d Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 20 Mar 2025 09:58:46 +1100 Subject: [PATCH 3/3] Simplify authorisation required email --- app/mailers/payment_mailer.rb | 3 +-- app/views/payment_mailer/authorization_required.html.haml | 4 ++-- app/views/payment_mailer/authorization_required.text.haml | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/mailers/payment_mailer.rb b/app/mailers/payment_mailer.rb index 0bd1ec6532..f9819d252a 100644 --- a/app/mailers/payment_mailer.rb +++ b/app/mailers/payment_mailer.rb @@ -16,8 +16,7 @@ class PaymentMailer < ApplicationMailer end def authorization_required(payment) - @payment = payment - @order = @payment.order + @order = payment.order shop_owner = @order.distributor.owner subject = I18n.t('spree.payment_mailer.authorization_required.subject', order: @order) diff --git a/app/views/payment_mailer/authorization_required.html.haml b/app/views/payment_mailer/authorization_required.html.haml index 080a88de06..391ccbc04a 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: @payment.order.number) -= link_to spree.edit_admin_order_url(@payment.order), spree.edit_admin_order_url(@payment.order) += t('spree.payment_mailer.authorization_required.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/authorization_required.text.haml b/app/views/payment_mailer/authorization_required.text.haml index b084ca2755..c494f054e3 100644 --- a/app/views/payment_mailer/authorization_required.text.haml +++ b/app/views/payment_mailer/authorization_required.text.haml @@ -1,3 +1,3 @@ -= t('spree.payment_mailer.authorization_required.message', order_number: @payment.order.number) += t('spree.payment_mailer.authorization_required.message', order_number: @order.number) -= link_to spree.edit_admin_order_url(@payment.order), spree.edit_admin_order_url(@payment.order) += link_to spree.edit_admin_order_url(@order), spree.edit_admin_order_url(@order)