[#10751] Only send the first invitation mail to the instructeur if email is not verified (from admin controller)

This commit is contained in:
Mathieu Magnin 2024-09-10 17:41:55 +02:00
parent d7811fca40
commit 790177c758
No known key found for this signature in database
GPG key ID: 8DCAFC82D7BA654E
2 changed files with 13 additions and 3 deletions

View file

@ -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