negos_app/app/mailers/customer_mailer.rb
2015-11-18 22:46:18 +01:00

85 lines
2.3 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class CustomerMailer < ApplicationMailer
layout "mail"
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.customer.confirm.subject
#
def confirm(customer)
@customer = customer
mail from: "contact@negos-pro.fr", to: customer.email, :subject => "Important : Activation de votre compte Négos"
end
def validate_account(customer)
@customer = customer
mail from: "contact@negos-pro.fr", to: customer.email, :subject => "Important : Validation de votre compte Négos"
end
def confirm_ins(customer)
@customer = customer
mail from: "contact@negos-pro.fr", to: customer.email, :subject => "Confirmation dinscription"
end
def validate_ins(customer)
@customer = customer
mail from: "contact@negos-pro.fr", to: customer.email, :subject => "Bienvenue chez NEGOS"
end
def notify_ins(customer)
@customer = customer
mail from: "contact@negos-pro.fr", to: "daniel@videlier.fr", bcc: "info@nicolasbally.com", :subject => "Nouveau compte client sur Negos"
end
def new_user(customer)
@customer = customer
@parent = @customer.parent
if @parent
#mail from: "no-reply@negos.pro", to: @parent.email, :subject => "Vous avez un nouvel affilié sur Negos.pro !" do |format|
# format.html { render layout: false }
#end
end
end
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.customer.reset_password.subject
#
def new_message(customer)
@customer = customer
mail from: "Négos.com <no-reply@negos.pro>", to: customer.email, :subject => "Vous avez un nouveau message privé"
end
def password_reset(customer)
@customer = customer
mail :to => @customer.email, :subject => "Reinitialisation du mot de passe.", :from => "Négos.com <no-reply@negos.pro>"
end
def new_commission(commission)
@commission = commission
if @commission.commission_type_id == 1 or @commission.commission_type_id == 2 or @commission.commission_type_id == 3
mail from: "no-reply@negos.pro", to: @commission.customer.email, :subject => "Vous avez reçu une commission sur Négos.com !" do |format|
format.html { render layout: false }
end
end
end
end