demarches-normaliennes/app/mailers/invite_mailer.rb

27 lines
570 B
Ruby
Raw Normal View History

class InviteMailer < ApplicationMailer
def invite_user(invite)
subject = "Participez à l'élaboration d'un dossier"
2018-05-31 15:53:04 +02:00
if invite.user.present?
send_mail(invite, subject, invite.email_sender)
end
end
def invite_guest(invite)
2018-05-31 15:50:13 +02:00
subject = "#{invite.email_sender} vous invite à consulter un dossier"
2018-05-31 15:52:50 +02:00
send_mail(invite, subject, invite.email_sender)
end
private
2018-05-31 15:52:50 +02:00
def send_mail(invite, subject, reply_to)
@invite = invite
2018-05-31 15:52:50 +02:00
email = invite.email
mail(to: email,
2016-11-17 12:17:59 +01:00
subject: subject,
reply_to: reply_to)
end
end