Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add html templates #1377

Merged
merged 4 commits into from
Jul 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
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