From 9bc734342003f575fa2f82f2aabdd835b3603460 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Tue, 30 Nov 2021 16:55:07 +0100 Subject: [PATCH 1/2] Create a mailer preview for the shipped email Available on http://localhost:3000/rails/mailers/spree/shipment/shipped --- spec/mailers/previews/shipment_preview.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 spec/mailers/previews/shipment_preview.rb diff --git a/spec/mailers/previews/shipment_preview.rb b/spec/mailers/previews/shipment_preview.rb new file mode 100644 index 0000000000..69721c1e9f --- /dev/null +++ b/spec/mailers/previews/shipment_preview.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'open_food_network/scope_variant_to_hub' + +module Spree + class ShipmentPreview < ActionMailer::Preview + def shipped + ShipmentMailer.shipped_email(Shipment.last) + end + end +end From 57dc10888c852c8170c6a0e51839ff10fe85151f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Tue, 30 Nov 2021 17:02:42 +0100 Subject: [PATCH 2/2] Improve shipped email design - Use default class for header, content - Use monospace font for the list of the items - Add line breaks for the list of the items --- .../shipment_mailer/shipped_email.html.haml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/app/views/spree/shipment_mailer/shipped_email.html.haml b/app/views/spree/shipment_mailer/shipped_email.html.haml index 39a174d388..cd8a9eb15d 100644 --- a/app/views/spree/shipment_mailer/shipped_email.html.haml +++ b/app/views/spree/shipment_mailer/shipped_email.html.haml @@ -1,22 +1,18 @@ -%p +%h3 = t('.dear_customer') -%p +%p.lead = t('.instructions', distributor: @shipment.order.distributor.name) %p - = "============================================================" - %br - = t('.shipment_summary') - %br - = "============================================================" + %strong + = t('.shipment_summary') -%p +%p{ style: "font-family: monospace, serif;" } - @shipment.manifest.each do |item| = item.variant.sku = item.variant.product.name = item.variant.options_text - %br - = "============================================================" + %br - if @shipment.tracking %p @@ -26,5 +22,5 @@ %p = t('.track_link', url: @shipment.tracking_url) -%p +%p.lead = t('.thanks')