2016-02-08 18:16:18 +01:00
|
|
|
class InviteMailer < ApplicationMailer
|
2018-03-20 17:47:37 +01:00
|
|
|
def invite_user(invite)
|
2016-02-08 18:16:18 +01:00
|
|
|
vars_mailer invite
|
|
|
|
|
2018-02-28 16:01:20 +01:00
|
|
|
send_mail invite.email, "demarches-simplifiees.fr - Participez à l'élaboration d'un dossier", invite.email_sender if invite.user.present?
|
2016-02-08 18:16:18 +01:00
|
|
|
end
|
|
|
|
|
2018-03-20 17:47:37 +01:00
|
|
|
def invite_guest(invite)
|
2016-02-08 18:16:18 +01:00
|
|
|
vars_mailer invite
|
|
|
|
|
2018-02-28 16:01:20 +01:00
|
|
|
send_mail invite.email, "Invitation - #{invite.email_sender} vous invite à consulter un dossier sur demarches-simplifiees.fr", invite.email_sender
|
2016-02-08 18:16:18 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2018-03-20 17:47:37 +01:00
|
|
|
def vars_mailer(invite)
|
2016-02-08 18:16:18 +01:00
|
|
|
@invite = invite
|
|
|
|
end
|
|
|
|
|
2018-03-20 17:47:37 +01:00
|
|
|
def send_mail(email, subject, reply_to)
|
2017-05-11 18:24:43 +02:00
|
|
|
mail(to: email,
|
2016-11-17 12:17:59 +01:00
|
|
|
subject: subject,
|
|
|
|
reply_to: reply_to)
|
2016-02-08 18:16:18 +01:00
|
|
|
end
|
|
|
|
end
|