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

  def newsletter(newsletter,email)
    
    @newsletter = newsletter
    @email = email
    @title = @newsletter.title
    @content = @newsletter.content
    if @newsletter.email_from?
      @from = @newsletter.email_from.to_s
    else
      @from = "Le Pic Vert <contact@lepicvert.asso.fr>"
    end
    mail(:to => @email, :from => @from, :subject => @title)
  end


  
  
  
end
