Do not use deliver_late
as the delayed job wouldn’t play nicely with the Mailer in lib/ in production
This commit is contained in:
parent
12639646e5
commit
4cc517ccba
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