commit
c4a6e74223
4 changed files with 48 additions and 46 deletions
|
@ -1,4 +1,3 @@
|
|||
module Mailers
|
||||
class NewAttestationMailer < ApplicationMailer
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
|
@ -30,4 +29,3 @@ module Mailers
|
|||
HEREDOC
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
module Mailers
|
||||
class ResendAttestationMailer < ApplicationMailer
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
|
@ -26,4 +25,3 @@ module Mailers
|
|||
HEREDOC
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace :'2018_06_05_resend_attestations' do
|
|||
|
||||
dossier.attestation = dossier.build_attestation
|
||||
|
||||
Mailers::ResendAttestationMailer.resend_attestation(dossier).deliver_later
|
||||
ResendAttestationMailer.resend_attestation(dossier).deliver_later
|
||||
puts "Email envoyé à #{email} pour le dossier #{dossier.id}"
|
||||
end
|
||||
end
|
|
@ -33,12 +33,18 @@ namespace :'2018_06_05_send_new_attestation' do
|
|||
|
||||
dossiers.each do |dossier|
|
||||
attestation = dossier.attestation
|
||||
|
||||
if attestation
|
||||
id = attestation.id
|
||||
attestation.destroy
|
||||
puts "Attestation #{id} détruite"
|
||||
end
|
||||
|
||||
dossier.attestation = dossier.build_attestation
|
||||
|
||||
Mailers::NewAttestationMailer.new_attestation(dossier).deliver_later
|
||||
puts "Email envoyé à #{email} pour le dossier #{dossier.id}"
|
||||
NewAttestationMailer.new_attestation(dossier).deliver_later
|
||||
puts "Email envoyé à #{dossier.user.email} pour le dossier #{dossier.id}"
|
||||
puts
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue