[#10751] Only send the first invitation mail to the instructeur if email is not verified (from admin controller)
This commit is contained in:
parent
d7811fca40
commit
790177c758
2 changed files with 13 additions and 3 deletions
|
@ -252,9 +252,11 @@ module Administrateurs
|
|||
"Les instructeurs ont bien été affectés à la démarche"
|
||||
end
|
||||
|
||||
known_instructeurs, new_instructeurs = instructeurs.partition { |instructeur| instructeur.user.email_verified_at }
|
||||
known_instructeurs, not_verified_instructeurs = instructeurs.partition { |instructeur| instructeur.user.email_verified_at }
|
||||
|
||||
new_instructeurs.each { InstructeurMailer.confirm_and_notify_added_instructeur(_1, groupe_instructeur, current_administrateur.email).deliver_later }
|
||||
not_verified_instructeurs.filter(&:previously_new_record?).each do
|
||||
InstructeurMailer.confirm_and_notify_added_instructeur(_1, groupe_instructeur, current_administrateur.email).deliver_later
|
||||
end
|
||||
|
||||
if known_instructeurs.present?
|
||||
GroupeInstructeurMailer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue