envoie une notification à chaque follower_instructeur après un commentaire déposé

This commit is contained in:
Christophe Robillard 2020-04-01 16:23:03 +02:00
parent 6d5709dbf5
commit 415d5c765e
5 changed files with 30 additions and 1 deletions

View file

@ -197,6 +197,9 @@ module Users
@commentaire = CommentaireService.build(current_user, dossier, commentaire_params)
if @commentaire.save
dossier.followers_instructeurs.each do |instructeur|
DossierMailer.notify_new_commentaire_to_instructeur(dossier, instructeur.email).deliver_later
end
flash.notice = "Votre message a bien été envoyé à linstructeur en charge de votre dossier."
redirect_to messagerie_dossier_path(dossier)
else