From 0b46c41ffd90b3a071239bf3aa9389b5ee0dd054 Mon Sep 17 00:00:00 2001 From: wandji20 Date: Tue, 23 Jul 2024 08:54:06 +0100 Subject: [PATCH] Update reply email for order confirmation mail [OFN-12509] --- app/helpers/mailer_helper.rb | 4 ++++ app/views/spree/order_mailer/_signoff.html.haml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb index 34708b8e0a..b07b04ca45 100644 --- a/app/helpers/mailer_helper.rb +++ b/app/helpers/mailer_helper.rb @@ -10,4 +10,8 @@ module MailerHelper link_to ofn, "https://www.openfoodnetwork.org" end end + + def order_reply_email(order) + order.distributor.email_address.presence || order.distributor.contact.email + end end diff --git a/app/views/spree/order_mailer/_signoff.html.haml b/app/views/spree/order_mailer/_signoff.html.haml index 5dc30ff83f..ef1e139ca9 100644 --- a/app/views/spree/order_mailer/_signoff.html.haml +++ b/app/views/spree/order_mailer/_signoff.html.haml @@ -9,8 +9,8 @@ %br = @order.distributor.phone || "" %br - %a{:href => "mailto:#{@order.distributor.contact.email}", :target => "_blank"} - = @order.distributor.email_address.presence || @order.distributor.contact.email + %a{:href => "mailto:#{order_reply_email(@order)}", :target => "_blank"} + = order_reply_email(@order) %br = @order.distributor.website || "" %br