Class: NimbleshopSimply::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/nimbleshop_simply/mailer.rb

Instance Method Summary collapse

Instance Method Details

#order_notification_to_buyer(order_number) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'app/mailers/nimbleshop_simply/mailer.rb', line 17

def order_notification_to_buyer(order_number)
  subject = "Order confirmation for order ##{order_number}"
  @order = Order.find_by_number!(order_number)

  @shop = Shop.current
  @payment_date = @order.created_at.to_s(:long) || @order.purchased_at.to_s(:long)

  mail_options = {to: @order.email, subject: subject}
  mail(mail_options)

end

#shipment_notification_to_buyer(order_number) ⇒ Object



29
30
31
32
33
34
35
36
# File 'app/mailers/nimbleshop_simply/mailer.rb', line 29

def shipment_notification_to_buyer(order_number)
  subject = "Items for order ##{order_number} have been shipped"
  @order = Order.find_by_number!(order_number)
  @shipment = @order.shipments.first

  mail_options = {to: @order.email, subject: subject}
  mail(mail_options)
end