Envoie une notif aux followers_instructeurs le souhaitant

après chaque message déposé par l'usager
This commit is contained in:
Christophe Robillard 2020-04-02 10:18:23 +02:00
parent 415d5c765e
commit 969478b706
7 changed files with 46 additions and 13 deletions

View file

@ -197,7 +197,9 @@ module Users
@commentaire = CommentaireService.build(current_user, dossier, commentaire_params)
if @commentaire.save
dossier.followers_instructeurs.each do |instructeur|
dossier.followers_instructeurs
.with_instant_email_message_notifications
.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."