#275: small tweaks.

This commit is contained in:
Paul Mackay
2014-11-09 11:19:26 +00:00
parent 05437e2a56
commit 9b7fd1c16b
2 changed files with 12 additions and 7 deletions

View File

@@ -1,12 +1,17 @@
require 'devise/mailers/helpers'
class ProducerMailer < ActionMailer::Base Spree::BaseMailer
include Devise::Mailers::Helpers
class ProducerMailer < Spree::BaseMailer
def order_cycle_report(producer, order_cycle)
@producer = producer
@coordinator = order_cycle.coordinator
@order_cycle = order_cycle
subject = "[Open Food Network] Order cycle report for "
# TODO: consider what happens if there is more than one distributor
first_producer = @order_cycle.distributors[0]
@distribution_date = @order_cycle.pickup_time_for first_producer
# puts @distribution_date
subject = "[Open Food Network] Order cycle report for #{@distribution_date}"
mail(to: @producer.email, from: from_address, subject: subject)
end

View File

@@ -1,7 +1,7 @@
Dear #{@producer.name},
We now have all the consumer orders for the food drop on #{}.
Please deliver to #{coordinator.address} between 9:30am and 10:30am. If this is not convenient then please call #{@coordinator.phone}.
We now have all the consumer orders for the food drop on #{@distribution_date}.
Please deliver to #{@coordinator.address.address1}, #{@coordinator.address.city}, #{@coordinator.address.zipcode} during the regular delivery time. If this is not convenient then please call #{@coordinator.phone}.
NB If you have to arrange a different delivery day and time, the school has requested that you do not come on site during drop off/pick up times (8:45-9:15 and 15:00-15:30)
@@ -10,7 +10,7 @@ Orders summary
Here is a summary of the orders for your products:
- @order_cycle.exchange_for_distributor.each do |exchange|
/ - @order_cycle.exchange_for_distributor.each do |exchange|
Detailed orders breakdown