From 58a79e9b0c9a2816d102d38123a4e5b96f53e31c Mon Sep 17 00:00:00 2001 From: Rob H Date: Fri, 23 Nov 2012 16:06:25 +1100 Subject: [PATCH 1/3] Minor changes to order confirm email --- .../spree/order_mailer/confirm_email.text.erb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/views/spree/order_mailer/confirm_email.text.erb b/app/views/spree/order_mailer/confirm_email.text.erb index 1502123479..4300d3fea5 100644 --- a/app/views/spree/order_mailer/confirm_email.text.erb +++ b/app/views/spree/order_mailer/confirm_email.text.erb @@ -1,10 +1,11 @@ -Dear Customer, +Dear <%= @order.bill_address.firstname %>, Please review and retain the following order information for your records. ============================================================ Order Summary ============================================================ +Order for: <%= @order.bill_address.full_name %> <% @order.line_items.each do |item| %> <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %> <% end %> @@ -15,15 +16,22 @@ Subtotal: <%= number_to_currency @order.item_total %> <% end %> Order Total: <%= number_to_currency(@order.total) %> +<% if @order.payment_method.include? "EFT" %> ============================================================ -Delivery Details +Payment Details +============================================================ +<%= @order.payment_method.description.html_safe %> + +<% end %> +============================================================ +Collection / Delivery Details ============================================================ Address: <%= @order.distributor.name %> <% address = @order.distributor.address %> <%= address.address1 %> <%= ",\n #{address.address2}" unless address.address2.blank? %> <%= [address.city, address.state_text, address.zipcode, address.country.name].compact.join ', ' %> -Colection time: +Collection time: <%= @order.distributor.next_collection_at %> Contact: <%= @order.distributor.contact %> From 3a3f427a8d2cadc479cff1809e195dd083d1bd79 Mon Sep 17 00:00:00 2001 From: Rob H Date: Fri, 7 Dec 2012 14:30:05 +1100 Subject: [PATCH 2/3] Reference name of payment method rather than payment method itself --- app/views/spree/order_mailer/confirm_email.text.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/order_mailer/confirm_email.text.erb b/app/views/spree/order_mailer/confirm_email.text.erb index 4300d3fea5..29549e4ffa 100644 --- a/app/views/spree/order_mailer/confirm_email.text.erb +++ b/app/views/spree/order_mailer/confirm_email.text.erb @@ -16,7 +16,7 @@ Subtotal: <%= number_to_currency @order.item_total %> <% end %> Order Total: <%= number_to_currency(@order.total) %> -<% if @order.payment_method.include? "EFT" %> +<% if @order.payment_method.name.include? "EFT" %> ============================================================ Payment Details ============================================================ From 9c9431ca7f55711232aa73797849963d79c75b43 Mon Sep 17 00:00:00 2001 From: Rob H Date: Fri, 7 Dec 2012 14:31:23 +1100 Subject: [PATCH 3/3] Install Letter Opener for development environment --- Gemfile | 2 ++ Gemfile.lock | 5 +++++ config/environments/development.rb | 3 +++ 3 files changed, 10 insertions(+) diff --git a/Gemfile b/Gemfile index 4041b11ff3..9068efe30d 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ end gem 'jquery-rails' + group :test, :development do # Pretty printed test output gem 'turn', '~> 0.8.3', :require => false @@ -50,5 +51,6 @@ group :test, :development do gem 'spork', '~> 1.0rc' gem 'pry-debugger' gem 'awesome_print' + gem "letter_opener" end diff --git a/Gemfile.lock b/Gemfile.lock index 2e5e808e92..19592a48e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -214,6 +214,10 @@ GEM activesupport (>= 3.0.0) railties (>= 3.0.0) kgio (2.7.4) + launchy (2.1.2) + addressable (~> 2.3) + letter_opener (1.0.0) + launchy (>= 2.0.4) libv8 (3.3.10.4) libwebsocket (0.1.5) addressable @@ -356,6 +360,7 @@ DEPENDENCIES faker haml jquery-rails + letter_opener pg pry-debugger rails (= 3.2.8) diff --git a/config/environments/development.rb b/config/environments/development.rb index 349ffc0a72..dfd2d7b171 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,6 +27,9 @@ Openfoodweb::Application.configure do # Expands the lines which load the assets config.assets.debug = true + + # Show emails using Letter Opener + config.action_mailer.delivery_method = :letter_opener end