Skip to content

Commit

Permalink
Merge branch 'DanielePalombo-add-html-templates'
Browse files Browse the repository at this point in the history
Resolves #1377

Conflicts:
	CHANGELOG.md
  • Loading branch information
Gregor MacDougall committed Jul 1, 2017
2 parents 86501e4 + 682f6ae commit 671f186
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
`Spree::Gateway::BogusSimple` and `Spree::Gateway::Bogus` were renamed into `Spree::PaymentMethod::SimpleBogusCreditCard` and `Spree::PaymentMethod::BogusCreditCard`
Run `rake solidus:migrations:rename_gateways:up` to migrate your data.

- 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= Spree.t('shipment_mailer.shipped_email.shipment_summary') %>
</p>
<table>
<% @shipment.manifest.each do |item| %>
<% @manifest.each do |item| %>
<tr>
<td><%= item.variant.sku %></td>
<td><%= item.variant.product.name %></td>
Expand All @@ -20,10 +20,10 @@
<% end %>
</table>
<p>
<%= 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 %>
</p>
<p>
<%= 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 %>
</p>
<p>
<%= Spree.t('shipment_mailer.shipped_email.thanks') %>
Expand Down
6 changes: 3 additions & 3 deletions core/app/views/spree/order_mailer/cancel_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<tr>
<td><%= item.variant.sku %></td>
<td>
<%= raw(item.variant.product.name) %>
<%= raw(item.variant.options_text) -%>
<%= item.variant.product.name %>
<%= item.variant.options_text -%>
</td>
<td>(<%=item.quantity%>) @ <%= item.single_money %> = <%= item.display_amount %></td>
</tr>
Expand All @@ -29,7 +29,7 @@
<% @order.adjustments.eligible.each do |adjustment| %>
<tr>
<td></td>
<td><%= raw(adjustment.label) %></td>
<td><%= sanitize(adjustment.label) %></td>
<td><%= adjustment.display_amount %></td>
</tr>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions core/app/views/spree/order_mailer/confirm_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<tr>
<td><%= item.variant.sku %></td>
<td>
<%= raw(item.variant.product.name) %>
<%= raw(item.variant.options_text) -%>
<%= item.variant.product.name %>
<%= item.variant.options_text -%>
</td>
<td>(<%=item.quantity%>) @ <%= item.single_money %> = <%= item.display_amount %></td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<table>
<tr>
<td>
<p class="lede">
<%= Spree.t('order_mailer.inventory_cancellation.dear_customer') %>
</p>
<p>
<%= Spree.t('order_mailer.inventory_cancellation.instructions') %>
</p>
<p>
<%= Spree.t('order_mailer.inventory_cancellation.order_summary_canceled') %>
</p>
<table>
<% @inventory_units.each do |item| %>
<tr>
<td><%= item.variant.sku %></td>
<td><%= item.variant.product.name %></td>
<td><%= item.variant.options_text -%></td>
</tr>
<% end %>
</table>
<p>
</td>
<td class="expander"></td>
</tr>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<% @reimbursement.return_items.exchange_requested.each do |return_item| %>
<tr>
<td>
<%= 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? %>
</td>
<td>
->
</td>
<td>
<%= 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? %>
</td>
</tr>
<% end %>
Expand Down
6 changes: 3 additions & 3 deletions core/spec/mailers/carton_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 671f186

Please sign in to comment.