mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-21 00:47:26 +00:00
Add translations to shipment mailer to send the mail in the customer's language
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
module Spree
|
||||
class ShipmentMailer < ApplicationMailer
|
||||
include I18nHelper
|
||||
helper MailerHelper
|
||||
|
||||
def shipped_email(shipment, delivery:)
|
||||
@@ -9,12 +10,14 @@ module Spree
|
||||
@order = @shipment.order
|
||||
@hide_ofn_navigation = @shipment.order.distributor.hide_ofn_navigation
|
||||
@delivery = delivery
|
||||
subject = t(base_subject,
|
||||
number: @order.number,
|
||||
distributor: @order.distributor.name)
|
||||
mail(to: @shipment.order.email,
|
||||
subject:,
|
||||
reply_to: @order.distributor.contact.email)
|
||||
I18n.with_locale valid_locale(@order.user) do
|
||||
subject = t(base_subject,
|
||||
number: @order.number,
|
||||
distributor: @order.distributor.name)
|
||||
mail(to: @shipment.order.email,
|
||||
subject:,
|
||||
reply_to: @order.distributor.contact.email)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user