Remove useless methods

This commit is contained in:
gregoirenovel 2018-05-31 15:52:50 +02:00
parent b364b8bfb3
commit 69e95f62c8
2 changed files with 5 additions and 12 deletions

View file

@ -35,13 +35,9 @@ class GestionnaireMailer < ApplicationMailer
private
def vars_mailer(email, args)
def send_mail(email, args, subject)
@args = args
@email = email
end
def send_mail(email, args, subject)
vars_mailer email, args
mail(to: email, subject: subject)
end

View file

@ -1,25 +1,22 @@
class InviteMailer < ApplicationMailer
def invite_user(invite)
vars_mailer(invite)
subject = "Participez à l'élaboration d'un dossier"
send_mail(invite.email, subject, invite.email_sender) if invite.user.present?
send_mail(invite, subject, invite.email_sender) if invite.user.present?
end
def invite_guest(invite)
vars_mailer(invite)
subject = "#{invite.email_sender} vous invite à consulter un dossier"
send_mail(invite.email, subject, invite.email_sender)
send_mail(invite, subject, invite.email_sender)
end
private
def vars_mailer(invite)
def send_mail(invite, subject, reply_to)
@invite = invite
end
email = invite.email
def send_mail(email, subject, reply_to)
mail(to: email,
subject: subject,
reply_to: reply_to)