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