30 lines
692 B
Ruby
30 lines
692 B
Ruby
class General < ActionMailer::Base
|
|
default :from => "Nicolas Bally <info@nicolasbally.com>"
|
|
self.default_url_options = {:host => HOSTNAME}
|
|
|
|
|
|
def send_newsletter(email,newsletter )
|
|
@newsletter = newsletter
|
|
if email.kind_of?(String)
|
|
email = email
|
|
else
|
|
@registrant = email
|
|
email = email.email
|
|
|
|
end
|
|
mail(:to => email, :subject => @newsletter.subject) do |format|
|
|
format.html { render :action => "send_newsletter"}
|
|
end
|
|
end
|
|
|
|
def confirm_email(registrant)
|
|
@registrant = registrant
|
|
|
|
mail(:to => @registrant.email, :subject => "Confirmation de votre adresse email.") do |format|
|
|
format.html { render :action => "confirm_email"}
|
|
end
|
|
|
|
end
|
|
|
|
end
|