demarches-normaliennes/app/mailers/groupe_instructeur_mailer.rb
2023-02-16 10:37:04 +01:00

24 lines
923 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class GroupeInstructeurMailer < ApplicationMailer
layout 'mailers/layout'
def notify_group_when_instructeurs_removed(group, removed_instructeurs, current_instructeur_email)
@removed_instructeur_emails = removed_instructeurs.map(&:email)
@group = group
@current_instructeur_email = current_instructeur_email
subject = "Suppression dun instructeur dans le groupe \"#{group.label}\""
emails = @group.instructeurs.map(&:email)
mail(bcc: emails, subject: subject)
end
def notify_removed_instructeurs(group, removed_instructeurs, current_instructeur_email)
removed_instructeur_emails = removed_instructeurs.map(&:email)
@group = group
@current_instructeur_email = current_instructeur_email
subject = "Vous avez été retiré du groupe \"#{group.label}\" de la démarche \"#{group.procedure.libelle}\""
mail(bcc: removed_instructeur_emails, subject: subject)
end
end