Comments (4)
👍 It would be especially good if the emails fit well on on a mobile device screen.
@BenMorganIO had a huge contribution on getting the emails to work with Foundation Ink, so it should be rather easy to add a bit of style.
from solidus.
I'd rather move the HTML emails to something like Blot this way a lot of the email templating is just automagically created and there's not tons of HTML tables to look at.
from solidus.
Closing due to staleness. (though I would still like better default templates)
from solidus.
Tutorial on how to customize your email confirmations in Solidus: https://www.bradient.com/posts/how-to-customize-your-email-confirmations-in-solidus-open-source-ecommerce
Order Confirm Email HTML Template:
<!-- app/views/spree/order_mailer/confirm_email.html.erb -->
<table>
<tr>
<td>
<p> </p>
<p class="lede">
<% if @order.billing_firstname %>
Dear <%= @order.billing_firstname %>,
<% else %>
<%= t('.dear_customer') %>
<% end %>
</p>
<p>
Thank you for your purchase from <%= @store.url %>. Please review and retain the following order information for your records.
<%#= t('.instructions') %>
</p>
<p> </p>
<p>Order Number: #<%= @order.number %></p>
<p>Order Date: <%= @order.created_at.strftime("%m/%d/%Y") %></p>
<p> </p>
<p><b><%= t('.order_summary').upcase %></b></p>
<br>
<table>
<thead>
<tr>
<th width="30%"></th>
<th width="17%">Sku</th>
<th width="17%">Name</th>
<th width="8%">Qty</th>
<th width="14%">Price</th>
<th width="14%">Total</th>
</tr>
<tr>
<th colspan="6">
<hr>
</th>
</tr>
</thead>
<% @order.line_items.each do |item| %>
<tr>
<td>
<%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
</td>
<td><%= item.variant.sku %></td>
<td>
<%= item.variant.product.name %>
<br>
<%= item.variant.options_text -%>
</td>
<td><%=item.quantity%></td>
<td><%= item.single_money %></td>
<td><%= item.display_amount %></td>
</tr>
<% end %>
<tr>
<td colspan="6">
<hr>
</td>
</tr>
<tr>
<td colspan="3"></td>
<td colspan="2">
<%= t('.subtotal') %>
</td>
<td>
<%= @order.display_item_total %>
</td>
</tr>
<% if @order.line_item_adjustments.exists? %>
<% if @order.all_adjustments.promotion.eligible.exists? %>
<% @order.all_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
<tr>
<td colspan="3"></td>
<td colspan="2">
<%= t('spree.promotion') %> <%= label %>:
</td>
<td><%= Spree::Money.new(adjustments.sum(&:amount), currency: @order.currency) %></td>
</tr>
<% end %>
<% end %>
<% end %>
<% @order.shipments.group_by { |s| s.selected_shipping_rate.try(:name) }.each do |name, shipments| %>
<tr>
<td colspan="3"></td>
<td colspan="2">
<%= t('spree.shipping') %> <%= name %>:
</td>
<td><%= Spree::Money.new(shipments.sum(&:total_before_tax), currency: @order.currency) %></td>
</tr>
<% end %>
<% if @order.all_adjustments.eligible.tax.exists? %>
<% @order.all_adjustments.eligible.tax.group_by(&:label).each do |label, adjustments| %>
<tr>
<td colspan="3"></td>
<td colspan="2">
<%#= t('spree.tax') %> <%= label %>
</td>
<td><%= Spree::Money.new(adjustments.sum(&:amount), currency: @order.currency) %></td>
</tr>
<% end %>
<% end %>
<% @order.adjustments.eligible.each do |adjustment| %>
<% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
<tr>
<td colspan="3"></td>
<td colspan="2">
<%= adjustment.label %>
</td>
<td><%= adjustment.display_amount %></td>
</tr>
<% end %>
<tr>
<td colspan="3"></td>
<td colspan="2">
<%= t('.total') %>
</td>
<td>
<%= @order.display_total %>
</td>
</tr>
</table>
<p> </p>
<p> </p>
<p>We will notify you when your order ships. If you have any questions, please contact us at <u><%= @store.mail_from_address %></u>.
<%#= t('.thanks') %>
</p>
</td>
<td class="expander"></td>
</tr>
</table>
Preview Template:
http://localhost:3000/rails/mailers/spree/mailer_previews/order/confirm
from solidus.
Related Issues (20)
- [Admin] Review batch actions a11y
- Unable to upload an image from Solidus API HOT 3
- Unable to add product in admin panel HOT 3
- [Admin] Release SolidusAdmin v0.0.1.alpha.1 HOT 1
- [Admin] add a banner for turning solidus_admin `on` and `off` HOT 2
- [Admin] allow to reuse or back port custom backend menu items in solidus_admin
- [Admin] Refactor "accounts/show" view into a separate component HOT 2
- Psych minimum version with Solidus-3.4 should be v4.0.1
- [Admin] Add page to create products
- [Admin] Integrate i18n-tasks with the new admin
- [Admin] Add order list index page
- PromotionCodeBatch fails generating million codes
- [admin] Backend sections to be ported to SolidusAdmin
- Release v4.2.0
- New admin breaks `assets:precompile` when host app has default Tailwind setup. HOT 2
- [Admin] Search by name in stock HOT 7
- Spree::Variant#set_position conflicts with acts_as_list
- Error when running tests on Macbook Air M1 HOT 6
- Release v4.3
- [Admin] Undefined destroy method call on non soft deletable Spree::Property
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solidus.