class NewsletterMails < ActionMailer::Base
  layout 'mail'
  
  default from: "Le Pic Vert <contact@lepicvert.asso.fr>"

  def newsletter(newsletter,email, options = {})
    @options = options
    @newsletter = newsletter
    @email = email
    @title = @newsletter.title
    @content = @newsletter.content
    if @newsletter.email_from?
      @from = Newsletter::EMAIL_TEXTES[@newsletter.email_from][0].to_s+ " <#{@newsletter.email_from}>"
    else
      @from = "Le Pic Vert <contact@lepicvert.asso.fr>"
    end
    mail(:to => @email, :from => @from, :subject => @title)
  end


  
  
  
end
