demarches-normaliennes/app/mailers/invite_mailer.rb

28 lines
691 B
Ruby
Raw Normal View History

class InviteMailer < ApplicationMailer
def invite_user(invite)
2018-05-31 15:26:07 +02:00
vars_mailer(invite)
2018-05-31 15:26:02 +02:00
subject = "demarches-simplifiees.fr - Participez à l'élaboration d'un dossier"
2018-05-31 15:26:02 +02:00
send_mail(invite.email, subject, invite.email_sender) if invite.user.present?
end
def invite_guest(invite)
2018-05-31 15:26:07 +02:00
vars_mailer(invite)
2018-05-31 15:26:02 +02:00
subject = "Invitation - #{invite.email_sender} vous invite à consulter un dossier sur demarches-simplifiees.fr"
2018-05-31 15:26:02 +02:00
send_mail(invite.email, subject, invite.email_sender)
end
private
def vars_mailer(invite)
@invite = invite
end
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