feat(groupe instructeur mailer): make two kind of notifications for removed instructeur
This commit is contained in:
parent
5be58c8223
commit
a46faf8cdf
10 changed files with 66 additions and 44 deletions
|
@ -146,19 +146,18 @@ module Administrateurs
|
|||
instructeur = groupe_instructeur.instructeurs.find_by(id: instructeur_id)
|
||||
|
||||
if groupe_instructeur.remove(instructeur)
|
||||
flash[:notice] = if procedure.routing_enabled?
|
||||
GroupeInstructeurMailer
|
||||
.notify_removed_instructeurs(groupe_instructeur, [instructeur], current_administrateur.email)
|
||||
.deliver_later
|
||||
|
||||
GroupeInstructeurMailer
|
||||
.notify_group_when_instructeurs_removed(groupe_instructeur, [instructeur], current_administrateur.email)
|
||||
.deliver_later
|
||||
|
||||
flash[:notice] = if instructeur.in?(procedure.instructeurs)
|
||||
"L’instructeur « #{instructeur.email} » a été retiré du groupe."
|
||||
else
|
||||
"L’instructeur a bien été désaffecté de la démarche"
|
||||
end
|
||||
GroupeInstructeurMailer
|
||||
.notify_removed_instructeur(groupe_instructeur, instructeur, current_administrateur.email)
|
||||
.deliver_later
|
||||
|
||||
GroupeInstructeurMailer
|
||||
.notify_group_when_instructeurs_removed(groupe_instructeur, [instructeur], current_administrateur.email)
|
||||
.deliver_later
|
||||
else
|
||||
flash[:alert] = if procedure.routing_enabled?
|
||||
if instructeur.present?
|
||||
|
|
|
@ -35,7 +35,7 @@ module Instructeurs
|
|||
if groupe_instructeur.remove(instructeur)
|
||||
flash[:notice] = "L’instructeur « #{instructeur.email} » a été retiré du groupe."
|
||||
GroupeInstructeurMailer
|
||||
.notify_removed_instructeurs(groupe_instructeur, [instructeur], current_user.email)
|
||||
.notify_removed_instructeur(groupe_instructeur, instructeur, current_user.email)
|
||||
.deliver_later
|
||||
|
||||
GroupeInstructeurMailer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue