# -*- encoding : utf-8 -*-
class ProductOrdersMails < ActionMailer::Base
  layout 'mail'
  
  default from:  "Negos <contact@negos.pro>"
  def fournisseur(product_order, fournisseur)
    @product_order = product_order
    @fournisseur = fournisseur
    @email = @fournisseur.email
    @title = "Commande achat via Négos"
    if @fournisseur.send_email
      mail(:to => @email, :bcc => "info@nicolasbally.com,daniel@videlier.fr", :subject => @title)
    end
  end

  def confirmation_cheque(product_order, options = {})
    @options = options
    @product_order = product_order
    if @product_order.reseaux_id != 19
      @email = @product_order.customer.email
      @title = "Merci pour votre commande."
      mail(:to => @email, :bcc => "info@nicolasbally.com", :subject => @title)
    end
  end
  
  def confirmation_cb(product_order, options = {})
    @options = options
    @product_order = product_order
    if @product_order.reseaux_id != 19
      @email = @product_order.customer.email
      @title = "Merci pour votre commande."
      mail(:to => @email, :bcc => "info@nicolasbally.com", :subject =>  @title)
    end
  end
  

  
  
  
end
