Commit 882dbee9 by Nguyen Quoc Kien

Edit: OrderNotifier - Content

parent 17b967c5
...@@ -7,7 +7,7 @@ class OrderNotifier < ApplicationMailer ...@@ -7,7 +7,7 @@ class OrderNotifier < ApplicationMailer
# #
def received(cart) def received(cart)
@cart = cart @cart = cart
mail to: cart.email, subject: 'Pragmatic Store Order Confirmation' mail to: cart.email, subject: 'Venshop - Order Carts'
end end
# Subject can be set in your I18n file at config/locales/en.yml # Subject can be set in your I18n file at config/locales/en.yml
......
<h1>OrderNotifier#received</h1> <h1>Venshop - Email confirmation</h1>
<h2>Your Cart</h2>
<p> <table class="table table-hover">
<%= @greeting %>, find me in app/views/order_notifier/received.html.erb <thead>
</p> <tr>
<th>Product name</th>
<th>Price</th>
<th>Quantity</th>
<th>Total price</th>
</tr>
</thead>
<tbody>
<% cart_products = @cart.cart_products %>
<% cart_products.each do |cart_product| %>
<% product = Product.find(cart_product.product_id) %>
<tr>
<td><%= product.name %>
<td><%= number_to_currency(cart_product.price/100.00) %></td>
<td><%= cart_product.number %></td>
<td><%= number_to_currency(cart_product.price/100.00 * cart_product.number) %></td>
</td>
<% end %>
<tr>
<td colspan="3">Total</td>
<td> <%= number_to_currency(@cart.total_price/100.00) %></td>
</tr>
</tbody>
</table>
\ No newline at end of file
<h1>OrderNotifier#shipped</h1> <h1>OrderNotifier#shipped</h1>
<p> <p>
<%= @greeting %>, 45 <%= @greeting %>
</p> </p>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment