Move CommentairesController#notify_user_user_with_mail to Commentaire
This commit is contained in:
parent
cae3e1f420
commit
9c3cde2b2e
3 changed files with 6 additions and 33 deletions
|
@ -5,6 +5,7 @@ class Commentaire < ActiveRecord::Base
|
|||
belongs_to :piece_justificative
|
||||
|
||||
after_save :notify_gestionnaires
|
||||
after_save :notify_user_with_mail
|
||||
|
||||
def header
|
||||
"#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M')
|
||||
|
@ -17,4 +18,8 @@ class Commentaire < ActiveRecord::Base
|
|||
NotificationService.new('commentaire', self.dossier.id).notify
|
||||
end
|
||||
end
|
||||
|
||||
def notify_user_with_mail
|
||||
NotificationMailer.new_answer(dossier).deliver_now! unless (current_user.try(:email) == dossier.user.email || email == 'contact@tps.apientreprise.fr')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue