Merge pull request #1839 from betagouv/frederic/fix_admin_attestation_mailing
Do not use deliver_late
This commit is contained in:
commit
d06b72fb80
1 changed files with 2 additions and 1 deletions
|
@ -3,7 +3,8 @@ namespace :'2018_04_03_attestation_closed_mail_discrepancy' do
|
|||
Administrateur.includes(:procedures).find_each(batch_size: 10) do |admin|
|
||||
procedures = admin.procedures.where(archived_at: nil).select { |p| p.closed_mail_template_attestation_inconsistency_state == :missing_tag }
|
||||
if procedures.any?
|
||||
Mailers::AttestationClosedMailDiscrepancyMailer.missing_attestation_tag_email(admin, procedures).deliver_later
|
||||
# Use `deliver_now` because the delayed job cannot find the `Mailers::AttestationClosedMailDiscrepancyMaile` class in production
|
||||
Mailers::AttestationClosedMailDiscrepancyMailer.missing_attestation_tag_email(admin, procedures).deliver_now!
|
||||
print "#{admin.email}\n"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue