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:
drummer83
2024-02-17 22:06:41 +01:00
parent bf7663b5ca
commit 4727e94eba
3 changed files with 8 additions and 13 deletions

View File

@@ -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)

View File

@@ -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'

View File

@@ -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."