diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e131df3475..66b558b5ce5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
## Solidus 2.3.0 (master, unreleased)
+- Add missing email html template for shipped_email and inventory_cancellation
- Deprecate `Spree::Core::CurrentStore` in favor of `Spree::CurrentStoreSelector`. [\#1993](https://github.com/solidusio/solidus/pull/1993)
- Deprecate `Spree::Order#assign_default_addresses!` in favor of `Order.new.assign_default_user_addresses`. [\#1954](https://github.com/solidusio/solidus/pull/1954) ([kennyadsl](https://github.com/kennyadsl))
- Change how line item options are allowed in line items controller. [\#1943](https://github.com/solidusio/solidus/pull/1943)
diff --git a/core/app/views/spree/shipment_mailer/shipped_email.html.erb b/core/app/views/spree/carton_mailer/shipped_email.html.erb
similarity index 82%
rename from core/app/views/spree/shipment_mailer/shipped_email.html.erb
rename to core/app/views/spree/carton_mailer/shipped_email.html.erb
index 24c0c6c1b34..b4a1892c8f1 100644
--- a/core/app/views/spree/shipment_mailer/shipped_email.html.erb
+++ b/core/app/views/spree/carton_mailer/shipped_email.html.erb
@@ -11,7 +11,7 @@
<%= Spree.t('shipment_mailer.shipped_email.shipment_summary') %>
- <% @shipment.manifest.each do |item| %>
+ <% @manifest.each do |item| %>
<%= item.variant.sku %> |
<%= item.variant.product.name %> |
@@ -20,10 +20,10 @@
<% end %>
- <%= Spree.t('shipment_mailer.shipped_email.track_information', tracking: @shipment.tracking) if @shipment.tracking %>
+ <%= Spree.t('shipment_mailer.shipped_email.track_information', tracking: @carton.tracking) if @carton.tracking %>
- <%= Spree.t('shipment_mailer.shipped_email.track_link', :url => @shipment.tracking_url) if @shipment.tracking_url %>
+ <%= Spree.t('shipment_mailer.shipped_email.track_link', :url => @carton.tracking_url) if @carton.tracking_url %>
<%= Spree.t('shipment_mailer.shipped_email.thanks') %>
diff --git a/core/app/views/spree/order_mailer/cancel_email.html.erb b/core/app/views/spree/order_mailer/cancel_email.html.erb
index 5fc4f6700a9..90358e7bedd 100644
--- a/core/app/views/spree/order_mailer/cancel_email.html.erb
+++ b/core/app/views/spree/order_mailer/cancel_email.html.erb
@@ -15,8 +15,8 @@
<%= item.variant.sku %> |
- <%= raw(item.variant.product.name) %>
- <%= raw(item.variant.options_text) -%>
+ <%= item.variant.product.name %>
+ <%= item.variant.options_text -%>
|
(<%=item.quantity%>) @ <%= item.single_money %> = <%= item.display_amount %> |
@@ -29,7 +29,7 @@
<% @order.adjustments.eligible.each do |adjustment| %>
|
- <%= raw(adjustment.label) %> |
+ <%= sanitize(adjustment.label) %> |
<%= adjustment.display_amount %> |
<% end %>
diff --git a/core/app/views/spree/order_mailer/confirm_email.html.erb b/core/app/views/spree/order_mailer/confirm_email.html.erb
index f5498dcf5ac..1b3e9a4ac75 100644
--- a/core/app/views/spree/order_mailer/confirm_email.html.erb
+++ b/core/app/views/spree/order_mailer/confirm_email.html.erb
@@ -15,8 +15,8 @@
<%= item.variant.sku %> |
- <%= raw(item.variant.product.name) %>
- <%= raw(item.variant.options_text) -%>
+ <%= item.variant.product.name %>
+ <%= item.variant.options_text -%>
|
(<%=item.quantity%>) @ <%= item.single_money %> = <%= item.display_amount %> |
diff --git a/core/app/views/spree/order_mailer/inventory_cancellation_email.html.erb b/core/app/views/spree/order_mailer/inventory_cancellation_email.html.erb
new file mode 100644
index 00000000000..b4a36db1225
--- /dev/null
+++ b/core/app/views/spree/order_mailer/inventory_cancellation_email.html.erb
@@ -0,0 +1,26 @@
+
+
+
+
+ <%= Spree.t('order_mailer.inventory_cancellation.dear_customer') %>
+
+
+ <%= Spree.t('order_mailer.inventory_cancellation.instructions') %>
+
+
+ <%= Spree.t('order_mailer.inventory_cancellation.order_summary_canceled') %>
+
+
+ <% @inventory_units.each do |item| %>
+
+ <%= item.variant.sku %> |
+ <%= item.variant.product.name %> |
+ <%= item.variant.options_text -%> |
+
+ <% end %>
+
+
+ |
+ |
+
+
diff --git a/core/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb b/core/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb
index baceffa5f2d..aaf518980c0 100644
--- a/core/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb
+++ b/core/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb
@@ -21,13 +21,13 @@
<% @reimbursement.return_items.exchange_requested.each do |return_item| %>
- <%= return_item.variant.sku %> <%= raw(return_item.variant.name) %> <%= "(#{raw(return_item.variant.options_text)})" if return_item.variant.options_text.present? %>
+ <%= return_item.variant.sku %> <%= return_item.variant.name %> <%= "(#{return_item.variant.options_text})" if return_item.variant.options_text.present? %>
|
->
|
- <%= return_item.exchange_variant.sku %> <%= raw(return_item.exchange_variant.name) %> <%= "(#{raw(return_item.exchange_variant.options_text)})" if return_item.exchange_variant.options_text.present? %>
+ <%= return_item.exchange_variant.sku %> <%= return_item.exchange_variant.name %> <%= "(#{return_item.exchange_variant.options_text})" if return_item.exchange_variant.options_text.present? %>
|
<% end %>
diff --git a/core/spec/mailers/carton_mailer_spec.rb b/core/spec/mailers/carton_mailer_spec.rb
index 7f85244a68c..1ca9ea5e603 100644
--- a/core/spec/mailers/carton_mailer_spec.rb
+++ b/core/spec/mailers/carton_mailer_spec.rb
@@ -11,8 +11,8 @@
# Regression test for https://github.com/spree/spree/issues/2196
it "doesn't include out of stock in the email body" do
shipment_email = Spree::CartonMailer.shipped_email(order: order, carton: carton)
- expect(shipment_email.body).not_to include(%{Out of Stock})
- expect(shipment_email.body).to include(%{Your order has been shipped})
+ expect(shipment_email).not_to have_body_text(%{Out of Stock})
+ expect(shipment_email).to have_body_text(%{Your order has been shipped})
expect(shipment_email.subject).to eq "#{order.store.name} Shipment Notification ##{order.number}"
end
@@ -38,7 +38,7 @@
specify do
shipped_email = Spree::CartonMailer.shipped_email(order: order, carton: carton)
- expect(shipped_email.body).to include("Caro Cliente,")
+ expect(shipped_email).to have_body_text("Caro Cliente,")
end
end
end