demarches-normaliennes/app/mailers/invite_mailer.rb

26 lines
611 B
Ruby
Raw Normal View History

class InviteMailer < ApplicationMailer
def invite_user invite
vars_mailer invite
2016-11-17 12:17:59 +01:00
send_mail invite.email, "TPS - Participez à l'élaboration d'un dossier", invite.email_sender unless invite.user.nil?
end
def invite_guest invite
vars_mailer invite
2016-11-17 12:17:59 +01:00
send_mail invite.email, "Invitation - #{invite.email_sender} vous invite à consulter un dossier sur la plateforme TPS", invite.email_sender
end
private
def vars_mailer invite
@invite = invite
end
2016-11-17 12:17:59 +01:00
def send_mail email, subject, reply_to
mail(to: email,
2016-11-17 12:17:59 +01:00
subject: subject,
reply_to: reply_to)
end
end