# -*- encoding : utf-8 -*-
class ExportsMails < ActionMailer::Base
  layout 'mail'
  
  default from: "info@nicolasbally.com"



  def send_export(donate_transaction_export, options = {})
    @options = options
    @donator_transaction_export = donate_transaction_export
    @email = "pascaline.prudhommemassue@le-petit-gravier.com"
    @title = "[export auto]["+@donator_transaction_export.short_type.to_s+"] "+@donator_transaction_export.end_at.to_s
    
    attachments["export-"+@donator_transaction_export.short_type.to_s+"-"+@donator_transaction_export.end_at.to_s.to_slug+"-#{@donator_transaction_export.id}.csv"] = File.read(@donator_transaction_export.csv_url)
    
    mail(:to => @email, :subject => @title)
  end
  
 


  
  
  
end
