2016-02-08 18:16:18 +01:00
|
|
|
class InviteMailer < ApplicationMailer
|
|
|
|
def invite_user invite
|
|
|
|
vars_mailer invite
|
|
|
|
|
2018-01-11 19:04:39 +01:00
|
|
|
send_mail invite.email, "TPS - Participez à l'élaboration d'un dossier", invite.email_sender if invite.user.present?
|
2016-02-08 18:16:18 +01:00
|
|
|
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
|
2016-02-08 18:16:18 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def vars_mailer invite
|
|
|
|
@invite = invite
|
|
|
|
end
|
|
|
|
|
2016-11-17 12:17:59 +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
|