mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Improve shipping mails
Replace simple table with proper order summary table. This requires the checkout_helper. Add order number to email content
This commit is contained in:
@@ -4,6 +4,7 @@ module Spree
|
||||
class ShipmentMailer < ApplicationMailer
|
||||
include I18nHelper
|
||||
helper MailerHelper
|
||||
helper 'checkout'
|
||||
|
||||
def shipped_email(shipment, delivery:)
|
||||
@shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment)
|
||||
|
||||
@@ -13,26 +13,20 @@
|
||||
intro: t(intro_key, distributor: @shipment.order.distributor.name),
|
||||
enterprise_for_logo: @enterprise_for_logo }
|
||||
|
||||
%p
|
||||
%strong
|
||||
= t('.shipment_summary')
|
||||
%h3
|
||||
= t('.shipment_summary', number: @order.number)
|
||||
|
||||
%p{ style: "font-family: monospace, serif;" }
|
||||
- @shipment.manifest.each do |item|
|
||||
= item.variant.sku
|
||||
= item.variant.product.name
|
||||
= item.variant.options_text
|
||||
%br
|
||||
= render 'shared/mailers/order_summary'
|
||||
|
||||
- if @shipment.tracking.present?
|
||||
%p.lead
|
||||
%p.callout
|
||||
= t('.track_information', tracking: @shipment.tracking)
|
||||
|
||||
- if @shipment.tracking_url
|
||||
%p.lead
|
||||
%p.callout
|
||||
= t('.track_link', url: @shipment.tracking_url)
|
||||
|
||||
%p.lead
|
||||
%p
|
||||
= t('.thanks')
|
||||
|
||||
= render 'shared/mailers/signoff_distributor'
|
||||
|
||||
@@ -3954,7 +3954,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
picked_up_subject: "Pick up notification of order %{number} at %{distributor}"
|
||||
shipped_intro_html: "Your order from <strong>%{distributor}</strong> has been shipped."
|
||||
picked_up_intro_html: "Your order from <strong>%{distributor}</strong> has been picked-up."
|
||||
shipment_summary: "Shipment Summary"
|
||||
shipment_summary: "Shipment summary for order %{number}"
|
||||
track_information: ! "Tracking Information: %{tracking}"
|
||||
track_link: ! "Tracking Link: %{url}"
|
||||
thanks: "Thank you for your business."
|
||||
|
||||
Reference in New Issue
Block a user