Skip to content

Instantly share code, notes, and snippets.

@peterberkenbosch
Created July 24, 2010 06:47
Show Gist options
  • Save peterberkenbosch/488482 to your computer and use it in GitHub Desktop.
Save peterberkenbosch/488482 to your computer and use it in GitHub Desktop.
OrderMailer.class_eval do
def confirm(order, resend = false)
@subject = (resend ? "[RESEND] " : "")
@subject += Spree::Config[:site_name] + ' ' + 'Order Confirmation #' + order.number
@body = {"order" => order}
@recipients = order.email
@from = Spree::Config[:order_from]
@bcc = order_bcc
@sent_on = Time.now
@content_type = "multipart/mixed"
part "text/plain" do |p|
p.body = render_message("confirm", :order => order)
p.transfer_encoding = "base64"
end
attachment "application/pdf" do |a|
a.body = Order.pdf_file(order,ActionController::Base.helpers)
a.filename = "Factuur #{order.number}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment