demarches-normaliennes/app/mailers/invite_mailer.rb
2021-05-26 18:05:14 +02:00

29 lines
667 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Preview all emails at http://localhost:3000/rails/mailers/invite_mailer
class InviteMailer < ApplicationMailer
layout 'mailers/layout'
def invite_user(invite)
subject = "Participez à l'élaboration dun dossier"
if invite.user.present?
send_mail(invite, subject, invite.email_sender)
end
end
def invite_guest(invite)
subject = "#{invite.email_sender} vous invite à consulter un dossier"
send_mail(invite, subject, invite.email_sender)
end
private
def send_mail(invite, subject, reply_to)
@invite = invite
email = invite.email
mail(to: email,
subject: subject,
reply_to: reply_to)
end
end