Merge pull request #2064 from betagouv/more-fixes

More fixes
This commit is contained in:
gregoirenovel 2018-06-07 17:53:51 +02:00 committed by GitHub
commit c4a6e74223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 46 deletions

View file

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

View file

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

View file

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

View file

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