Module: Spree::ShipmentMailerDecorator
- Defined in:
- app/mailer/spree/shipment_mailer_decorator.rb
Instance Method Summary collapse
-
#shipped_email(shipment, resend = false) ⇒ Object
@gem-override spree_emails-5.3.6/app/mailers/spree/shipment_mailer.rb#shipped_email 管理画面で設定したカスタム件名を使えるよう再実装する。.
Instance Method Details
#shipped_email(shipment, resend = false) ⇒ Object
@gem-override spree_emails-5.3.6/app/mailers/spree/shipment_mailer.rb#shipped_email 管理画面で設定したカスタム件名を使えるよう再実装する。
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/mailer/spree/shipment_mailer_decorator.rb', line 6 def shipped_email(shipment, resend = false) @shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment) @order = @shipment.order current_store = @shipment.store @spree_custom_email = current_store.custom_emails.find_by(mail_type: 'shipped_email') subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '') if @spree_custom_email&.subject.present? subject += @spree_custom_email.subject else subject += "#{current_store.name} #{Spree.t('shipment_mailer.shipped_email.subject')} ##{@order.number}" end mail(to: @order.email, from: from_address, subject: subject, store_url: current_store.url_or_custom_domain, reply_to: reply_to_address) end |