70 lines
1.6 KiB
Ruby
70 lines
1.6 KiB
Ruby
# -*- encoding : utf-8 -*-
|
|
class PetitionMails < ActionMailer::Base
|
|
layout 'mail2'
|
|
|
|
default from: "Jipe <contact@jipe.fr>"
|
|
|
|
|
|
def fourrure(fourrure_sender)
|
|
@fourrure_sender = fourrure_sender
|
|
|
|
|
|
@_action_has_layout = false
|
|
|
|
mail(:to => "patrice.delaurens@agriculture.gouv.fr", :subject => "Interdiction des élevages de visons", :layout => false)
|
|
|
|
|
|
end
|
|
|
|
def confirmation(signator, options = {})
|
|
@options = options
|
|
@signator = signator
|
|
|
|
@petition = @signator.petition
|
|
@petition_lang = @petition.petition_langs.where(:lang_site_id => @signator.lang_site.id).first
|
|
|
|
|
|
@email = @signator.email
|
|
if @signator.lang_site_id == 2
|
|
@title = "Important: to confirm your signature."
|
|
else
|
|
@title = "Important : pour valider votre signature."
|
|
end
|
|
mail(:to => @email, :subject => @title)
|
|
end
|
|
|
|
def thanks(signator, options = {})
|
|
@options = options
|
|
@signator = signator
|
|
|
|
@petition = @signator.petition
|
|
@petition_lang = @petition.petition_langs.where(:lang_site_id => @signator.lang_site.id).first
|
|
|
|
|
|
@email = @signator.email
|
|
|
|
if @signator.lang_site_id == 2
|
|
@title = "Thank you for your signature."
|
|
else
|
|
@title = "Merci pour votre signature."
|
|
end
|
|
|
|
if @petition.id == 18
|
|
mail(:from => "Muriel - Jipe <muriel@jipe.fr>",:to => @email, :subject => @title)
|
|
else
|
|
mail(:to => @email, :subject => @title)
|
|
end
|
|
|
|
end
|
|
|
|
def animal_petition(aps)
|
|
@aps = aps
|
|
mail(:to => @aps.email, :subject => "Merci pour votre signature.")
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|