Files
openfoodnetwork/app/mailers/spree/shipment_mailer.rb
drummer83 40fbdc596a Add a 'reply to' email address where it makes sense and has been missing until now
This includes the following emails:

Manager invitation email: reply to inviting enterprise

Authorize payment email: reply to distributor

Order cancellation email: reply to distributor

Shipment notification email: reply to distributor
2025-02-10 21:51:04 +01:00

23 lines
644 B
Ruby

# frozen_string_literal: true
module Spree
class ShipmentMailer < ApplicationMailer
def shipped_email(shipment, delivery:)
@shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment)
@delivery = delivery
@order = @shipment.order
subject = base_subject
mail(to: @order.email,
subject:,
reply_to: @order.distributor.contact.email)
end
private
def base_subject
default_subject = @delivery ? default_i18n_subject : t('.picked_up_subject')
"#{@shipment.order.distributor.name} #{default_subject} ##{@shipment.order.number}"
end
end
end